4

I am using an activity group in my application to show the tabs.

Each time when I click on any tab, its total memory usage increases by 1 MB. And also if I again go to any inner activity within that tab, its memory usage increases again.

I am using getLocalActivityManager() to start activities.

    //argIntent this is my intent
    //argActivityId is the id ot activity

     argIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

    // the id is stored in an arraylist
     int intListSize = arlstGroup.size();

     arlstGroup.add(intListSize, argActivityId);
     Window objWindow = getLocalActivityManager().startActivity(argActivityId, argIntent);
     View objView = objWindow.getDecorView();
     setContentView(objView);

and also i am using destroyActivity() for destroying each activity but the memory-usage is still increaing.

Then I tried with destroying all activities from localActivityManger when each sub activity starts. The problem still remains though.

How can I solve this problem?

Please help me...

Mike T
  • 4,747
  • 4
  • 32
  • 52
Jomia
  • 3,414
  • 10
  • 46
  • 63

1 Answers1

0

Do you use large objects (Drawables, Bitmaps etc.) in your activities? Check this article for details about avoiding memory leaks:

http://android-developers.blogspot.de/2009/01/avoiding-memory-leaks.html

maddob
  • 989
  • 1
  • 12
  • 29