Maximum item caching limit of any list in Android

1.1k Views Asked by At

What will happen if we keep on loading thousands of items in any type list in Android? Will Android be able to recycle it correctly?

2

There are 2 best solutions below

0
Omid Heshmatinia On BEST ANSWER

Short Answer

In your case, there Would not be any problem in recycling of list view or recycler view.

Long Answer

The list view or recycler view would just load and show the amount of data which are visible on the UI. So the size of the items in it is not any problem.

BUT

there are some cases which would make problem. for example if you put a recycler view inside a Scroll view! In such cases all of the items are loaded and there is no GC. That's where you would have big problems with lots of data.

3
Glen Pierce On

List is an Interface, not a class, so there are ArrayLists and LinkedLists and several other types, but ArrayLists for example can handle up to Integer.MAX_VALUE elements. I've never had a problem with an ArrayList and garbage collection at least and thousands of items is far below the limits of that class.