I am experiencing some out of memory issues on my app and want to call the garbage collector, but I am not sure in which method I should call it.
Here is my code:
public static void CleanUpMemory(){
System.runFinalization();
Runtime.getRuntime().gc();
System.gc();
}
Currently I am calling this method in onStop()
but is it better to call it inside onDestroy()
?