[android-developers] Re: Memory Leak when creating OnClickListener

2009-08-17 Thread Dan Sherman
Still struggling with this, anyone have any ideas? - Dan On Sun, Aug 16, 2009 at 12:07 AM, Dan Sherman impact...@gmail.com wrote: After some more testing, it doesn't look like it has anything to do with creating a new OnClickListener each time. The following snippet (using the same

[android-developers] Re: Memory Leak when creating OnClickListener

2009-08-17 Thread Dianne Hackborn
What is the type of the object in the array that is increasing in number? On Mon, Aug 17, 2009 at 9:36 AM, Dan Sherman impact...@gmail.com wrote: Still struggling with this, anyone have any ideas? - Dan On Sun, Aug 16, 2009 at 12:07 AM, Dan Sherman impact...@gmail.com wrote: After some

[android-developers] Re: Memory Leak when creating OnClickListener

2009-08-17 Thread Dan Sherman
Looks to be a Runnable (from what I can tell). On Mon, Aug 17, 2009 at 12:49 PM, Dianne Hackborn hack...@android.comwrote: What is the type of the object in the array that is increasing in number? On Mon, Aug 17, 2009 at 9:36 AM, Dan Sherman impact...@gmail.com wrote: Still struggling

[android-developers] Re: Memory Leak when creating OnClickListener

2009-08-17 Thread Dianne Hackborn
On Mon, Aug 17, 2009 at 9:57 AM, Dan Sherman impact...@gmail.com wrote: Looks to be a Runnable (from what I can tell). It can't just be a Runnable, it needs to be a concrete implementation of Runnable. I am pretty sure hat will show you the actual class implementation, since it only deals in

[android-developers] Re: Memory Leak when creating OnClickListener

2009-08-17 Thread Dan Sherman
I'll check it out tonight when I get access to the dump again. But from what I remember, it was just a really long list of nested Runnables (I'm sure I missed something). Would it help if I posted the dump? - Dan On Mon, Aug 17, 2009 at 1:39 PM, Dianne Hackborn hack...@android.comwrote: On

[android-developers] Re: Memory Leak when creating OnClickListener

2009-08-17 Thread Romain Guy
Please do. On Mon, Aug 17, 2009 at 10:45 AM, Dan Shermanimpact...@gmail.com wrote: I'll check it out tonight when I get access to the dump again.  But from what I remember, it was just a really long list of nested Runnables (I'm sure I missed something). Would it help if I posted the dump?

[android-developers] Re: Memory Leak when creating OnClickListener

2009-08-17 Thread Romain Guy
You are indeed causing a leak in a nasty way. What's going on is the following: - The button is attached to a window - You press the button - The button executes the click listener - In the click listener you setContentView() - This in turns detaches the button from the window - The button

[android-developers] Re: Memory Leak when creating OnClickListener

2009-08-17 Thread Dan Sherman
Thanks a ton :) I understand completely that this is a horrible use of setContentView(), and I imagined that was what the problem was, however, just wanted to make sure I wasn't losing my marbles here. Great job with Android so far, keep up the good work :) On Mon, Aug 17, 2009 at 11:14 PM,

[android-developers] Re: Memory Leak when creating OnClickListener

2009-08-15 Thread Balwinder Kaur (T-Mobile USA)
I'm curious too, but seriously you should go with the other options you mentioned. Creating new onClickListeners with each click is NOT a good idea ! Balwinder Kaur Open Source Development Center ·T· · ·Mobile· stick together The views, opinions and statements in this email are those of the

[android-developers] Re: Memory Leak when creating OnClickListener

2009-08-15 Thread Dan Sherman
After some more testing, it doesn't look like it has anything to do with creating a new OnClickListener each time. The following snippet (using the same Layouts), produces the same leak. Its significantly shorter, and when looking at a heap dump, from what I can tell, an array called mActions in