As far as I know /proc/{pid}/stat only provides vsize/vss and rss, both of
which are basically useless for determining real memory usage. Memory usage
however is really complicated to determine.
See for example on here
http://stackoverflow.com/questions/2298208/how-to-discover-memory-usage-of-my-application-in-android/2299813#2299813
the
"ps" output containing vss and rss, and how much they differ from a more
realistic value given by pss.
If this becomes an argument, one thing you could do is tell them to look at
the size shown in Running Services. Pre-GB, if you have a service running
then your process will be there with a somewhat reasonable number for its
RAM usage. Starting with GB all application processes even if they aren't
actively running by switching to the list of cached processes.
On Thu, May 19, 2011 at 12:50 AM, String <[email protected]>wrote:
> So I think I've finally plugged all my memory leaks (tip: watch out for
> Handlers which outlive your Activity), and overall, my apps seem to be doing
> pretty well in this regard. But in the last couple of days I've had a user
> complaining that one app is using far too much memory, and furthermore that
> it gets worse as the app is running longer (it has a clock widgets, so it'll
> stay resident in memory if things aren't too tight). He's saying
> it's frequently at 40-50MB, and will climb over 80MB.
>
> Now, you and I both know that this isn't possible given the constraints of
> the Dalvik heap. Following up with this user, I learn that he's getting
> these numbers from Process Monitor Widget (PMW), and sure enough, when I
> install it I see something similar. I reached out to the dev of PMW, and he
> informs me that he's getting the figures "from the kernel process
> description file located @ /proc/$pid/stat." Not being a Linux kernel guy,
> I'm not well versed on such matters, but I'm strongly suspecting that it's
> not valid for Dalvik processes.
>
> For example: right now the app in question on my N1 is showing 57MB in PMW,
> while a heap dump in DDMS shows 3.4MB. This latter number seems quite
> reasonable to me, but I don't feel OK in just going back to this user and
> saying "PWM, and other apps of its ilk, are just wrong." That could easily
> develop into a "he said, she said" situation.
>
> So, I'm hoping somebody here - ideally someone on the framework team (you
> here, Romain? ;^) ) - can speak more authoritatively about this. And
> hopefully, other devs that face this situation in the future can be better
> equipped to deal with it. Anyone?
>
> String
>
> --
> 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
--
Dianne Hackborn
Android framework engineer
[email protected]
Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails. 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 [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