It's not hard to debug. Dump the heap (with DDMS) and use a tool like
MAT to see what's going on.

On Tue, Sep 7, 2010 at 7:05 PM, Indicator Veritatis <mej1...@yahoo.com> wrote:
> It is one of the ironies of Java that though it is harder to write a
> memory leak than in C++, once you do manage it, it is harder to debug
> than in C++;)
>
> IBM developerworks has some good articles on it.
>
> So, for example, though the article is old, and mentions rather dated
> GC technology, I do believe that the hints in
> http://www.ibm.com/developerworks/java/library/j-leaks/ are still
> pretty up to date for finding memory leaks.
>
> Unfortunately, he talks about using Jprobe, which I don't think you
> can run on an Android phone. But
> http://kohlerm.blogspot.com/2009/04/analyzing-memory-usage-off-your-android.html
> suggests using the hprof-conv tool and describes how to do that.
>
> On Sep 7, 1:26 pm, Jason Van Anden <robotiss...@gmail.com> wrote:
>> I have seen the same issue - and I suspect a memory leak.  What would be
>> best way to track something like this down?
>>
>> jOn Tue, Sep 7, 2010 at 3:08 PM, Romain Guy <romain...@android.com> wrote:
>> > It could also be a memory leak in your application.
>>
>> > On Tue, Sep 7, 2010 at 12:06 PM, blahblah...@gmail.com
>> > <blahblah...@gmail.com> wrote:
>> > > It's happening on the emulator when running 2.0 or 2.2. No
>> > > compatibility mode AFAIK. I just did some testing and we are still
>> > > getting OutOfMemoryError after changing screen orientation 3 times -
>> > > it always gives the error the third time even though I added gc();
>> > > runFinalization(); gc() just before the createBitmap. I'm thinking it
>> > > must be either a memory leak in Android or heap fragmentation. So far
>> > > I don't have any workaround.
>>
>> > > On Sep 3, 2:40 pm, Matt Kanninen <mathias...@gmail.com> wrote:
>> > >> I found OutOfMemory Bitmap errors happened more frequently when I had
>> > >> a compatibility mode set.  Although that was just on the Moto Droid,
>> > >> on Android 2.1, back in December.
>>
>> > > --
>> > > 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<android-developers%2bunsubscr...@googlegroups.com>
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/android-developers?hl=en
>>
>> > --
>> > Romain Guy
>> > Android framework engineer
>> > romain...@android.com
>>
>> > Note: please don't send private questions to me, as I don't have time
>> > to provide private support.  All such questions should be posted on
>> > public forums, where I and others can see and answer them
>>
>> > --
>> > 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<android-developers%2bunsubscr...@googlegroups.com>
>> > For more options, visit this group at
>> >http://groups.google.com/group/android-developers?hl=en
>>
>>
>
> --
> 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
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

-- 
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