What does actually Lost RAM mean in dumpsys meminfo - android

When i get memory information using adb shell dumpsys meminfo it shows something called LOST RAM. I know that this equals to TOTAL - FREE RAM - USED RAM but i need to know what this really means.
Is it just a calculation error/issue ? or
Do this amount(LOST RAM) is
really lost because of some hardware or other bug?.
If this is really a bug and not a calculation error so then should i go for a device with low LOST RAM when i'm buying an android device. and should i avoid devices with high LOST RAM value. Please provide me a clear answer for this.

Lost RAM is just RAM that is unaccounted for, it will take all the processes ram usage and add them up the difference between that value and the actual amount of ram left is known as lost ram because the OS can't account for what is using it. It's software related and from what I read can be from ION debug, or drivers that allocate and track their own ram. I don't think it should play any part in your consideration when buying a new android device though.

Related

Emulator is starting and running slowly for android application using elicpse

I am using Eclipse new v22.6.2 . My emulator is starting and running very slowly... How to overcomes this problem..using 3.7"WQVGA(240x432:IDPI).
system configuration is 2GB RAM and 64 bit windows 8 and i3 processor
Increase eclipse Memory size since you emulator is using its memory to run. See here to give more memory.
Genymotion is the better option if you want to test your app with emulator.
In my personal opinion it is always best to test app with the real devices.
I recommend using Genymotion (https://www.genymotion.com/). It is free for personal use.
Just had this issue myself (even though I believe to have a nice piece of hardware) and found that it's really faster as it claims to be.
In my notebook, it will get up and running in about 20-30 secs. Hope that will suit your needs.

Memory monitor in Android Studio reports different RAM usage than the device

When investigating RAM usage in an app I am working on, I have been using the Memory Monitor tool in Android Studio (can be accessed in Android Studio by going to Tools>Android>Memory Monitor). I have noticed the RAM usage of my app that is reported in Memory Monitor, is always far lower than when viewing the RAM usage from the device (can be accessed by going to Settings>Apps>Running). As you can see in the screenshots below, Memory Monitor is reporting about 18MB of RAM usage (23MB if you include free space), but the device is reporting 43MB.
Why the difference and also is one more accurate than the other?
I suspect that the memory monitor tool is talking to the dalvik virtual machine about heap allocations made by Java code, and the device manager is showing what the entire process is using for memory. So the first does not include overhead or memory used by the virtual machine itself (or its text and libraries), or any off-heap allocations (sometimes native code can allocate memory that isn't directly visible to the VM).
See https://developer.android.com/tools/debugging/debugging-memory.html#ViewingAllocations and try running the command:
adb shell dumpsys meminfo <package_name>
to get a more precise breakdown of the run-time memory usage of your application.
I've tested the Android Studio's Memory Monitor's Allocated can be get this way programmatically:
long allocatedMemory = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
But this only works to get information of the current app.

Improving speed on Android Emulator

Hello I am running a W510 Lenovo Laptop which is generally rapid in most computing circumstances but when running Eclipse and trying to run the AVD emulator it is like molasses. I know that there are some alternative emulators and that I can improve the RAM on the emulator but what other ways can I speed it up.
I am thinking of upgrading from 4GB of RAM on my Lenovo to 12GB would this make a big difference?
Thanks
If you have a dedicated GPU, try turning GPU acceleration on to significantly boost graphics performance. It is turned off by default. To turn it on, edit the AVD you use, and on the hardware section, click "New". Find "GPU emulation", add it, and set the value to yes.
Assuming that you only run eclipse, the emulator, and a bunch of Chrome tabs (no other RAM hungry processes going on), 4GB should be enough. My setup also has 4GB RAM with no swap space and if you check system monitor, most likely you still have spare free RAM. I personally still have 800 MB of free RAM when all of those things are open (with device ram size set to 512 MB).
Hope this may work for others:
I've faced the same problem with my high config pc have 3i 4GB , but the emulator works so slow
I found something that worked for me and hope it may work for others i would love to share it here
i've just added Device ram size to My existing AVD and set the size to 1000MB(Because i've enough to allot mine is 6GB)
No the speed of my AVD was ultimate hope it may help you.
EDIT 1:
You may also set some attribute for better performance like
set GPU Emulation = yes

How much memory should a typical android application use?

I have developed a file parsing application on the android platform. How do I check how much memory my application is actually using up ? I tried the adb shell cat /proc/meminfo command but this does not give me how much memory my application is using. it just gives general info about the overall memory. And how much memory should an application typically use up ? what is usual or unusual ? Any help is appreciated. Thanks !
Android apps are constrained to a certain amount of memory. As it's quite (insanely?) low, I think you shouldn't feel guilty about using all of it!
The limit is 16 MB on very old devices, 24 MB or 32 MB on newer ones. There doesn't seem to be much info on the size for different devices, and nobody seems to know why the limit is so small when modern phones have 1-2 GB of RAM.
http://blog.javia.org/how-to-work-around-androids-24-mb-memory-limit/
https://groups.google.com/forum/?fromgroups=#!topic/android-platform/7zKQlrDcypQ
Aha, I found some concrete numbers on the limit:
http://dubroy.com/memory_management_for_android_apps.pdf
G1: 16MB
Droid: 24MB
Nexus One: 32MB
Xoom: 48MB
You can use DDMS > Allocation Tracker to track memory usage and Heap Allocation for your app
http://developer.android.com/resources/articles/track-mem.html
To Track the overall memory of a PID you could use following two methods in ActivityManager
To get a PID of your app :
List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses ()
and then the MemoryInfo
MemoryInfo[] getProcessMemoryInfo (int[] pids)
you might want to take a look at this one. How do I discover memory usage of my application in Android? Or simply try
ActivityManager.getMemoryInfo()
you can check the application memory usage in application mananger, you can check it in the link
You can get the memory usage of your android application with the following command:
Assuming you have adb in PATH:
adb shell dumpsys meminfo com.<your.package>
To see live updation of memory in use, you can try
watch "adb shell dumpsys meminfo com.<your.package>"
Hope this helps

Android - get USS memory allocation programmatically

I force this problem:
I need to know USS memory allocation (= how much RAM is allocated by your APP) for my app. I know, it is possible to get this info from "adb shell procrank", but I want to have it programmatically. Is there any way how to do it? Or any fully functional snippet? Up to know, I haven't been successfull and checking via adb shell is not comfortable and slow.

Categories

Resources