2
I’m doing an application and I noticed that it is consuming a lot of RAM, approximately 70MB. I have a button that inflates an extra layout with random data and that keep changing dynamically that because of this increases the memory used in Android.
Researching deeply I realized that the Hello World Andorid already consumes 13MB and he only has one activity
and a text.
My question is how to improve memory usage in application code? How do I clear cache memory or kill an Activity? (In my app killing an Activity doesn’t solve much)
it says that image processing enhances the memory reserved for app, this can occur with png too?
– Guilherme Ramos
Any type of image, so it is highly recommended that you decrease the size of the image before loading, like creating a thumbnail. For this look for Bitmap.createScaledBitmap the process is basically to create a reduced file based on the original file. Edit: Logic that create the thumbnail only to demonstrate in the gallery, but have the option of the user to view the image in the original size.
– Clebao
Even if this link is a good suggestion, this reply will not be valid if one day the link ceases to work. So, and also because it’s important for the community to have content right here, you’d better respond with more complete answers. Can you elaborate more your answer? A summary of the content of the link would help a lot! Learn more on this item in our Community FAQ: Answers that only contain links are good?
– bfavaretto