Thanks.

I would still like to get an explanation as to why the Java APIs show
a lot more memory available than the UNIX commands available in the
adb shell.

memInfo = new ActivityManager.MemoryInfo();
        mgr.getMemoryInfo(memInfo);
        s = String.valueOf(memInfo.availMem);

Is the Dalvik machine allocating memory at start that is not available
to the Linux kernel but shown form the Java APIs?
Or is it something about those buffers etc. that Diane mentions above
that are not shown as available to Linux?

This has been puzzling me for quite some time now ...

Thanks,

-Magnus

On Mar 23, 7:28 pm, Dianne Hackborn <[email protected]> wrote:
> The available RAM is pretty meaningless.  I wouldn't suggest using 64MB at
> this point.  You might want to target 128MB but this all really depends --
> the G1 has 192MB, but 40MB of that is used by the radio image, another bunch
> is not available to Linux but does get used for surfaces and other buffers,
> and we have about 90MB available to Linux.  So if there is truly 128MB
> available to Linux, you are probably in decent shape -- that is similar to
> the G1, especially if you are putting surfaces and other buffers in that
> 128MB.
>
> Anyway, the kernel is set up to do demand paging, so mostly what you will
> see when memory is tight is a lot of paging and/or the platform unable to
> keep any background processes running (or even killing service processes),
> which also makes things slow.
>
>
>
>
>
> On Mon, Mar 23, 2009 at 6:25 AM, Magnus <[email protected]> wrote:
>
> > Hi,
>
> > I was trying to understand/estimate how much memory that is reasonable
> > to have in a device running Android.
>
> > When booting up the system fresh you can see in the emulator that if I
> > configure the emulator to have 64MB RAM (emulator -qemu -m 64)
> > available it gives you an available RAM of a few MB, whereas if you
> > configure the emulator to have 128 MB of RAM it seems to give you just
> > over 40 MB free aftoot, indicating that the system uses about 80 MB of
> > RAM after boot. How does this work in the 64MB RAM case, does the
> > system not start some services or does it use paging to fit into the
> > small RAM?
>
> > I can't seem to locate any good descriptions on how Android works on
> > this lower level.
>
> > Thanks,
>
> > -Magnus
>
> --
> 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.  All such questions should be posted on public
> forums, where I and others can see and answer them.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to