My setup consists of two tabs setup with viewpager. Each tab contains a fragment which contains a recyclerview that displays list of songs.
The issue is, when loading large amount of songs into the recyclerview, the ui just freezes up for some time. For number of songs above 2000, the systems freezes for a long time and afterwards throws an OutOfMemory
error.
Note: The loading of data into the recyclerview in a simple fragment or activity has no performance issues at all even when the data set is very large.
How can I optimize this?