Adithya, Please also remember that Android will grow and shrink the heap depending on the needs of your application. Obviously it will have some maximum beyond which no growth will happen. This means that ever growing app will report small amount of free memory just before the heap has been extended and more of free memory after the increment.
Daniel On Mon, Dec 6, 2010 at 10:59 AM, adithya <[email protected]> wrote: > Thanks ! > > Is it the case that java.lang.Runtime.totalMemory will return the > total system memory allocated to the android emulator/phone and > java.lang.Runtime.freeMemory will return the available system memory > for the emulator/phone ? Is there a way to confirm the total memory > allocated to the emulator is the same as the API methods return ? > > If that is the case then its fine for system level information. Can > anyone please tell me for application level? Should > ActivityManager.MemoryInfo suffice ? > > Thanks, > Adithya. > > > > On Dec 6, 9:59 am, DanH <[email protected]> wrote: >> Well, there's always java.lang.Runtime.freeMemory and totalMemory. >> >> On Dec 5, 10:08 pm, adithya <[email protected]> wrote: >> >> > Hi, >> >> > I have gone through the ActivityManager.MemoryInfo and >> > Debug.MemoryInfo classes and the API's provided by them to get an >> > insight of the available memory present and the memory consumption >> > being done. I have been through the methods provided by Runtime class >> > to get memory information. >> >> > I still haven't got a clear idea as to how to retrieve the system >> > level memory information. >> >> > For e.g. lets say the emulator is allocated 56MB of RAM and 24MB is >> > being used (which can be a combination of cached, actual memory which >> > cannot be GCed and other memory like dirty which can be freed whenever >> > required.). All at the system level and the application level. >> >> > I would be really glad if someone guided me because i read that its >> > not that accurate to get memory usage in android ! I am using android >> > sdk 2.2. >> >> > Thanks, >> > Adithya. >> >> > > -- > 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 -- Daniel Drozdzewski -- 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

