[sorry created the previous post in another thread, so reposting]

Hi everyone,

What would be the best way to debug a leaking program?

I have developed a media player (includes a background service doing the 
playing, and a UI, and I access getResources(), MediaStore and things 
like this often).

Whenever I rotate the screen or reenter the app the total memory 
allocated to my process grows some 70 to 100KB. After some 6-10 
rotations it is dead due to an out of memory exception.

In the meantime I have removed every static modifier to global vars, 
added an onDestroy function that unregisters the intents and service 
connection (and even puts every global var to null again :P), but still 
the program memory grows... and dies after a few rotations.

Given the situation I even made the program stop right after just 
calling setContentView, and still the memory leaks:

@Override
   public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       context = this;                  System.gc();

       requestWindowFeature(Window.FEATURE_PROGRESS);
       requestWindowFeature(Window.PROGRESS_VISIBILITY_ON);
       requestWindowFeature(Window.FEATURE_NO_TITLE);

       WindowManager windowManager         = (WindowManager)
                                               
getSystemService(Context.WINDOW_SERVICE);
       this.display                         = 
windowManager.getDefaultDisplay();
       setContentView(R.layout.songfest_main);
             if(true)
           return;
(...)
}



so can the the XML inflater be causing this leak? can we get a leak from 
the xml itself?

How would you propose to proceed from here... im running out of options...

Cheers,
Filipe


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to