Reputation: 31
In my android app, there are ample of image resources, i have implemented them in the way to achieve the maximum performance.
I have freed the memory in almost every screen with System.gc()
and calculated heap size
in every screen.
The flow of app is when we finish working on the app it restarted from beginning to create new modules. When a user repeat the same process to create modules on 4-5 occurrence the app get force close.
The erroe in the logcat is the same memory budget exceeds VM budget error
.
Is there any way to stop the app completely on restarting or handling large bitmaps
over multiple occurrences.
I am not aware about the code to close an app completely and in this app i cant proceed finishing all the activities.
There are some limitations. Please help. Thanks.
Upvotes: 0
Views: 566
Reputation: 564
System.gc() in your code the Java VM may or may not decide at runtime to do a garbage collection at that point. Try calling recycle on your bitmaps after you finish your business with them. This will help freeing your memory on time.
Upvotes: 2