Take the 2-minute tour ×

I have an Android app that is quite complex with a good amount of activities. It has a sliding "Facebook" style menu, so the backstack can get pretty full. I already added the REORDER_TO_FRONT flag to Intents launched from the main menu, but I still get out of memory crashes quite often.

I profiled my heap with Eclipse Memory Analyzer and found that much of the memory was being taken up by RelativeLayouts (my ListView items). Is there anything I can do to remedy this safely? Is there a logical way to free the memory all these List items on the backstack are taking?

Thanks for your help.

share|improve this question
add comment

1 Answer

Why don't you call finish() in the onPause() method to kill the Activities and flatten the stack? You can always persist their state and instantiate it once onCreate() is called on it.

share|improve this answer
I would rather not since the user would not be able to go back to a previous page. I don't believe that is the expected behavior for an Android user. –  Ben Harris Jun 16 '12 at 20:27
add comment

Your Answer


