---
title: "Comment by Kennedy Odife on \"A Subtle Memory Leak - Fragment, RecyclerView and its Adapter\" | Hashnode"
description: "Nice article. What if you create the adapter locally inside onViewCreated? I think that will be good also"
url: "https://hashnode.com/posts/a-subtle-memory-leak-fragment-recyclerview-and-its-adapter/5e74b6b6bc8844135ba516cd/comment/5e88ba122fcec10052c10124"
---

[Discussion](https://hashnode.com/posts/a-subtle-memory-leak-fragment-recyclerview-and-its-adapter/5e74b6b6bc8844135ba516cd)

Comment [A Subtle Memory Leak - Fragment, RecyclerView and its Adapter](https://hashnode.com/posts/a-subtle-memory-leak-fragment-recyclerview-and-its-adapter/5e74b6b6bc8844135ba516cd)

[Kennedy Odife](https://hashnode.com/@odifek)

[Apr 4, 2020](https://hashnode.com/posts/a-subtle-memory-leak-fragment-recyclerview-and-its-adapter/5e74b6b6bc8844135ba516cd/comment/5e88ba122fcec10052c10124)

Nice article. What if you create the adapter locally inside onViewCreated? I think that will be good also

[Charles Muchene](https://hashnode.com/@charlesmuchene)

[Apr 26, 2020](https://hashnode.com/posts/a-subtle-memory-leak-fragment-recyclerview-and-its-adapter/5e74b6b6bc8844135ba516cd/comment/5e88ba122fcec10052c10124#reply-5ea50a400135fc417662f582)

That's all good if you have static data and all of it is available when `onViewCreated` finishes. I guess that should work.
