2014-05-09 18:37 GMT+04:00 Daniel Rindt <daniel.ri...@gmail.com>:

> 2014-05-09 15:53 GMT+02:00 Kostya Vasilyev <kmans...@gmail.com>:
> > Well, personally, I usually use the object histogram at the starting
> point
> > -- filtered by my app's package.
> >
> > When I see something that looks strange, I right click on a object class
> and
> > do "merge shortest paths to object roots" to investigate.
> >
> > That's just me -- I've not used "leak suspects" -- but maybe you'd be
> able
> > to see something interesting in the histogram?
>
> I tried what you said, but please tell me what i can recognize as
> "strange"?
> I don't find a definitve guide to find a leak. I can't really see any
> weird thing.
>

Well, I usually look at instance counts of large objects that act as
allocation roots (e.g. allocate and own lots of other objects). In my case,
they're fragments (more or less) and activities.

For you app, you may want to dump total memory used by the image loader /
cache -- although MAT won't help here.


> The only conclusion i come to is that every new opened activity consumes
> more heap and i have the feeling that this causes the oom.
>

An activity instance is not that heavy by itself -- but in your app, sounds
like it also owns a fair amount of bitmap data.


> > That's a well known library, but I guess it still needs to be configured
> in
> > a way that makes sense for your app's flow.
>
> I've set it for now just to preserve memory.
>

Well, that sounds like a nice magic switch but personally, I would verify
what actually happens to memory allocations.

For example, would this library, with this setting, be able to get rid of
in-memory bitmaps used by stopped activities?

In ImageViews still attached to the content of their respective activities?


> > There have been a few discussions on this list about it -- with no clear
> > answer that I can remember. This should be fairly easy to verify in the
> > debugger.
> >
> > Maybe you can use the lifecycle callbacks (onStop / onStart) to release
> some
> > memory?
>
> You mean set collections to null?
>

Yes, that sort of thing, and verifying that it actually did something (I'd
trigger GC in DDMS a few times, until it reaches a stable point).

-- K

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to