I am creating a music player app. I have three activities that have recycler views in it. I am loading music from server using exoplayer. I am loading like 10-20 images of 20kb size into recycler views using glide. My app is crashing in some phones with low memory. Android profiler shows that my app is consuming too much memory (screenshot below) App is running very smoothly in high-end phones. Can someone please tell me how to solve this memory issue so that app will run smoothly in all phones.
I have already added heaplarge=true in manifest
add this in your build.gradle in android section
dexOptions {
javaMaxHeapSize "4g" //specify the heap size for the dex process
}
and add this in default config section
multiDexEnabled true
finally add dependency:
compile 'com.android.support:multidex:1.0.2'
Maybe you have the Memory leak
in your app.
you can try to use leakCanary
to help you find some Activity leak
.
link-to-github leakCanary
Also you can use link to Analyze your code analyze
try android StrictMode, it can help you improve your code Strict Mode
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With