|High memory usage reported in running services activity||Joan Pujol||1/23/11 12:16 PM|
I've seen that my background service is allocating 25Mbs according to
the Running Services android window. As it is a lot of memory that I
think I don't use I looked to ddms and also made a head dump of my
process and then the memory usage is only 2.9Mb
What's is the real memory usage? If it is the ddms one is there any
way to let running services give the correct usage? Because I'm afraid
that if some user look at the running services it will say that the
application is wasting a lot of memory.
|Re: [android-developers] High memory usage reported in running services activity||Dianne Hackborn||1/23/11 1:00 PM|
You can use "adb shell dumpsys memoryinfo" to see more details information about app memory usage.
Note that Running Services (especially starting with Gingerbread) is showing the aggregate of your process and any processes you are causing to keep around. Look at the details to see if there are other processes involved, and it should say why they are needed.
Or it could just be that you have allocations elsewhere -- for example I think DDMS only shows the Java heap in its main view. If you have a lot of native allocations (bitmaps, web view, etc) then they may not show up there.
Android framework engineer
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.
|Re: High memory usage reported in running services activity||Joan Pujol||1/23/11 2:19 PM|
I've tried with the dumpsys memoryinfo and it says I have the same
that is reported in running services.
It seems you are right and that the memory is used in the native part:
allocated: 18259 4659 N/A 22918
But how can I get some detail of where is used the native memory.
Because with only the number I haven't any clue.
And also, if the native memory isn't displayed in the HEAD DUMP, it is
> On Sun, Jan 23, 2011 at 12:16 PM, Joan Pujol <joanpu...@gmail.com> wrote:> > email@example.com<android-developers%2Bunsubs cr...@googlegroups.com>
> > For more options, visit this group at> hack...@android.com
|Re: [android-developers] Re: High memory usage reported in running services activity||Dianne Hackborn||1/23/11 2:32 PM|
If you aren't using WebView, this is most likely bitmaps. I would suggest looking in the dalvik heap info to see what bitmaps are being held. Unfortunately bitmap memory is not currently part of the Dalvik heap, so it can be a little hard to track down.hac...@android.com
|Re: High memory usage reported in running services activity||Joan Pujol||1/24/11 6:06 AM|
A lot of thank Dianne,
I've both bitmaps, and webview but with your info I think I will be
able to solve my memory problems.
But for completeness:
The adb shell dumpsys is the best accurate info? There's no other info
with native memory usage?
And also, Is it ok to open a feature request to propagate the native
memory on the head dumps and see the real numbers?
> > > > firstname.lastname@example.org<android-developers%2Bunsubs cr...@googlegroups.com><android-developers%2Bunsubs