Figure out how to get OOME quickly (usually rotating and going in and
out if activities). Comment EVERYTHING out. Test that there is zero
gain. Get a hprof dump when app is freshly loaded, do the rotate and
in and out test, get another dump, compare the histograms (right most
icon in MAT). You may find some extra objects. Click Histogram and
search for the object. Right-click and expand the menus - the one you
need to look for is something like "ignore all phantom/soft/weak
references" (can't remember exact name since not at workstation). You
may see loads of orphaned objects e.g. Matrix so you'd do m.reset()
instead of m = new Matrix() if you want to reuse it.

Once you have attained zero gain, slowly uncomment blocks of code
until you find your leaks.

On May 14, 12:38 am, olivier <[email protected]> wrote:
> Dears,
>
> I am metting an OutOfMemory exception after a while, while inflating
> an XML View with a bitmap.
>
> The problem occurs after opening many times activities that are using
> many bitmap but always inflated from the XML.
>
> I check with MAT the Memory.
> First question : I don't retain any of my Activity in memory - If I
> filter on the name of my Activity, i get Objects = 0, but on some
> activities I could see RetainedHeap >= 302. Does this indicate a
> leak ?
>
> After that, I try to compare my memory in different points of time, to
> see the objects that have been created. But I can't find any thing
> significant.
>
> My Question is : If I don't retain activities in memory what could be
> the leak reasons ?
> What tools/Method to use to find it ?
>
> Regards,
>
> Olivier

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

Reply via email to