How will you find if your application is running on low memory, or out of memory?
How will you find if your application is running on low memory, or out of memory?
1 Answer
To check for the memory simple run this periodically
Runtime.getRuntime().maxMemory();
Runtime.getRuntime().totalMemory();
Runtime.getRuntime().freeMemory();
it will show all the details such as maximum memory your app is taking or total memory your app acquires.
you can also override the following method to get the memory information -
@Override
public void onLowMemory() {
super.onLowMemory();
Log.w(TAG, "onLowMemory() -> clearImageCacheFu!!!");
clearImageCacheFu();
dispatchGoogleTracker();
stopGoogleTracker();
}