What is 'nebulous' about it? By free memory, he most likely means "the amount of memory not yet allocated to any process, available (to user, not system processes) on the heap".
Now true, the whole purpose of a garbage collector is that it can change that value on the fly by freeing up memory as it finds no one is using it anymore. But the concept itself as given above is not nebulous at all. It is of course also true that the figure is subject to misinterpretion, especially if, as seems likely, the OP posing the question is simply not familiar with programming for a system using a garbage collector. I have noticed a lot of people trying to make the transition to Android from a C/C++ background without first grounding themselves in Java, so they do ask questions like this. For them, what is far more useful than warning them of the "99% chance of misinterpretation" is pointing them to an article (does it exist yet?) explaining the special characteristics of the garbage collector in Android, those characteristics that have an impact on the way the user uses it. I have in mind something like http://www.ibm.com/developerworks/ibm/library/i-gctroub/ or http://www.ibm.com/developerworks/ibm/library/i-garbage1/ but for Android's GC rather than IBM's. I would find this useful too, since I do not know where to find, for example, whether or not the GC in Android runs on its own thread, runs "stop the world" (STW), is pure "mark and sweep" vs. "mark, sweep and compact"... On Aug 10, 12:38 pm, Dianne Hackborn <[email protected]> wrote: > What are you intending to do with this? Free memory is a very nebulous > concept. There is a 99% chance that anyone seeing a number associated with > free memory will greatly misinterpret what that means. > > (Note that for Running Services the amount of "free" memory takes > information from /proc/meminfo but actually includes other memory making the > number given to the user fairly meaningful specifically for what they are > looking at in that UI.) > > > > On Fri, Aug 6, 2010 at 10:37 PM, Jonathan <[email protected]> wrote: > > Hi - I am simply looking for a way to get the total Ram available to > > the device. I have been able to get available Ram from a MemoryInfo > > object with no problems, but what I really want to know is what > > percentage is available - and so need the total. The Runtime methods > > give absurdly low values. Is there a simple way to do this? Do I > > have to go into the ndk to get at /proc/meminfo? > > > Thank you, > > > Jonathan > > > -- > > 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]<android-developers%[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

