I implemented a method that reads the user's contacts and puts them in the ArrayList<Friend> list and it turns out that there are 300 contacts in my address book and in order to fill the array, the method has to create 300 objects and put them into a list
and I get these lines in the log:
07-27 16: 20: 39.663 18588-18698 / com.fittingroom.newtimezone I / art: Explicit concurrent mark sweep GC freed 7741 (518KB) AllocSpace objects, 2 (40KB) LOS objects, 12% free, 26MB / 30MB, paused 1.294ms total 55.011ms 07-27 16: 20: 40.952 18588-18698 / com.fittingroom.newtimezone I / art: Explicit concurrent mark sweep GC freed 18304 (700KB) AllocSpace objects, 0 (0B) LOS objects, 12% free, 27MB / 31MB; , 12% free, 27MB / 31MB, paused 1.332ms total 52.736ms 07-27 16: 20: 43.519 18588-18698 / com.fittingroom.newtimezone I / art: Explicit concurrent mark sweep GC freed 20440 (782KB) AllocSpace objects, 0 (0B) LOS objects, 12% free, 27MB / 31MB, paused 1.587ms total 53.310ms 07-27 16: 20: 44.782 18588-18698 / com.fittingroom.newtimezone I / art: Explicit concurrent mark sweep GC freed 20851 (799KB ) AllocSpace objects, 0 (0B) LOS objects, 12% f ree, 27MB / 31MB, paused 1.539ms total 53.030ms
I read and understood that this collector collects what is no longer needed in the process of creating these objects ...
The question is, what if the user has 1000 contacts?
Will the application crash in this case?
And how to load the entire list at once? maybe it is worth loading it in RecyclerView in parts?
Tell me how right?
ArrayListthat contains all these contacts ... The question is, do you need to take all the contacts from the phone book right away or load them in parts? - Aleksey Timoshchenko