1

Due to the "out of memory" issue, is it possible to reset the HEAP via restart app?

Below is the code I found from "stackoverflow" to restart app. But from Eclipse DDMS, the Heap did not reset.

Intent i = getBaseContext().getPackageManager().getLaunchIntentForPackage( getBaseContext().getPackageName() );
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);

Thanks...

2
  • why not releasing the objects you allocated and run gc ?
    – Mr.Me
    Feb 23, 2013 at 18:08
  • Actually, it's the google map v1, just can not release it at all. I have tried the way "code.google.com/p/android/issues/detail?id=2181" mentioned but from DDMS, even the "MapActivty" is "onDestroy", the heap still not released. By now, I plan to kill the process and restart it again. Feb 24, 2013 at 9:56

1 Answer 1

0

Due to the "out of memory" issue, is it possible to reset the HEAP via restart app?

Eventually, Android will terminate your process, after it moves to the background for a while. The new process will start with a fresh heap.

Below is the code I found from "stackoverflow" to restart app. But from Eclipse DDMS, the Heap did not reset.

That is because you are still working with the same process.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.