I would like to know how much memory dalvik VM is allocated with (heap + stack) to run applications.
There is an option while creating an AVD to allocate RAM i.e. by default 96 MB and initial heap size i.e. by default 16 MB ..What is the significance of this? can anyone explain? Programatically if i want to calculate the system memory which i assume is the memory allocated to the dalvik VM then is there a way to do that ? Next, if i want to find the memory consumption at the application is there a way ? There is an adb command like 'adb dumpsys' which gives memory related information .Can i do something similar in code. Is there an API available ? I know i am asking a very vague question but thats how memory management is ! :) Thanks, Adithya. On Dec 6, 5:07 pm, DanH <[email protected]> wrote: > Are you asking whether there's a tool to show the 'non-heap heap" -- > the heap space occupied by non-Java objects? I don't know of > anything, but I'm no expert at that? > > On Dec 6, 4: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

