What EXACTLY is VM heap & what does it do? - Motorola Droid Bionic

What EXACTLY is VM heap & what does it do?

It's the largest chunk of memory that a single instance of an application (ran through the Dalvik VM) can obtain. There's also a corresponding minimum setting. It works much the same way as passing the Xmin and Xmax parameters to a java VM when launching it from the command line.

relative to battery life?
Thats awesome...thx for responding!
*Does the size of the VM heap have an effect on battery life? If yes then how?

ups2525 said:
Thats awesome...thx for responding!
*Does the size of the VM heap have an effect on battery life? If yes then how?
Click to expand...
Click to collapse
My brain tells me yes, a little, through logic.
If it can utilize more memory, that means more information passing through more locations, but it shouldn't be to significant.
You messing around in your build.prop?
I took a peak at mine last night, and the heap is set at 64m in unl3ashed, or blurred, or whatever th3ory is calling his rom now.

Virtual Machine heap most directly influences battery life in terms of how often your phone will perform what's called 'garbage collection', or trimming your apps' memory usage.
A higher heap size means an app can use more space before getting cut, so it can improve your battery life a little bit as garbage collection uses CPU and thus battery. It *can* negatively impact the performance of smaller apps as it will allow the more demanding ones to 'hog' your memory resources. On a superphone like the Bionic it's not likely to hurt, but on, say, a Galaxy S (or the Charge, which I came from) with 512MB of RAM, 120mb of which was actually user accessible, it made a difference.
Short version: with a phone with 1GB of RAM, higher is *probably* better for battery life and won't have much impact on performance. YMMV.

Vm heap tool is a great app to use to experiment with heap sizes if you are rooted. Check it out
Sent from my DROID BIONIC using XDA App

Thx!
Thanks for the breakdown guys...

Related

Compcache

Just curious, I've been flashing the latest nightlies and in the cyanogenmod settings I see 'use compcache'. I have it unchecked, any difference if I check it. I found a you tube video about 2 phones running with and without compcache. Compcache seemed to load pages better over time, but not initially. Any help would be much appreciated
Copied from this post on another thread..
Very roughly you have a finite amount of memory (RAM). When memory is accessed it is virtual addressing, so an application is given a piece of memory, but this isn't real RAM, the operating system manages this and maps it to where the data really is. Because of this system, the OS can give out more memory than is actually available. It can then store some of this memory on a storage medium and "swap" it with some other programmes memory when one is needed and the other isn't. This is how swap works.
With compcache, instead of storing the dormant memory on a hard disk it is compressed and stored in the RAM itself on a virtual disk. This takes up some RAM, but because it is compressed, more RAM is spare tha n if the data were left in memory as it is. Again this has the effect that more memory space can be handed out than the RAM that is really there.
Because Android manages applications so that when memory runs out it just closes applications running in the background, more applications can reside in the larger virtual memory space than before, making multi-tasking more pleasant and responsive.
I know that nfinitefx45 took compcache out of his latest builds in both the Stock and ZenHeroFX ROMs. I don't know all the technical reasons behind it, but I think it just didn't improve performance enough to be worth leaving it in. Granted those are Sense-based ROMs though which are generally a little slower and "bloatier" in nature than AOSP, so the performance difference maybe be greater in CM.
chromiumleaf said:
I know that nfinitefx45 took compcache out of his latest builds in both the Stock and ZenHeroFX ROMs. I don't know all the technical reasons behind it, but I think it just didn't improve performance enough to be worth leaving it in. Granted those are Sense-based ROMs though which are generally a little slower and "bloatier" in nature than AOSP, so the performance difference maybe be greater in CM.
Click to expand...
Click to collapse
Thank you for the response, just wasn't sure. Since Darch left it unchecked, I figured I would ask

[Q] Ginger Yoshi installing 41%CC hack questions.

Hi all,
For my dream Yoshi is asking during install:
Code:
install 41% CC hack, or install 60mb swap.
I selected the 41% option,
Now I am wondering if that was the right one.
Heeter
Heeter said:
Hi all,
For my dream Yoshi is asking during install:
Code:
install 41% CC hack, or install 60mb swap.
I selected the 41% option,
Now I am wondering if that was the right one.
Heeter
Click to expand...
Click to collapse
probably not
that is a huge chunk of memory to be wasting
compcache takes a proportion of physical memory, compresses it and uses it as a swap device. The benefit of this is that it is faster than normal swap.. your device thinks its got more memory than it has so apps will stay alive longer
but the price you pay is the memory is slower apps don't get killed and clutter up memory and eventually you slow to a crawl because every pointless little app is sitting in swap
the 41% value means 41% of your ram is being compressed and used as the swap space
which is very high.
you should be able to just change the compcache in the cyanogen settings
but don't take my word for cc being a bad idea
I just have the point of view that I would prefer my phone have a few key processes running well than having lots processes running badly
but what is worse is you can tell the rom is just a ripoff because it is very easy to add the higher options prior to compiling , it is just a case of adding a few strings to some xml files, no need for hacks.
Very nice thanks
Effdee said:
probably not
that is a huge chunk of memory to be wasting
compcache takes a proportion of physical memory, compresses it and uses it as a swap device. The benefit of this is that it is faster than normal swap.. your device thinks its got more memory than it has so apps will stay alive longer
but the price you pay is the memory is slower apps don't get killed and clutter up memory and eventually you slow to a crawl because every pointless little app is sitting in swap
the 41% value means 41% of your ram is being compressed and used as the swap space
which is very high.
you should be able to just change the compcache in the cyanogen settings
but don't take my word for cc being a bad idea
I just have the point of view that I would prefer my phone have a few key processes running well than having lots processes running badly
but what is worse is you can tell the rom is just a ripoff because it is very easy to add the higher options prior to compiling , it is just a case of adding a few strings to some xml files, no need for hacks.
Click to expand...
Click to collapse
thanx for clearin on cc!
goin back from mt4gslide ==>mt3g dam ))

[Q] Would enabling swap boost real world performance?

I'm interested in any real world experiences of people using a swap partition on the SD card or similar solutions. I mostly see guides about how you enable swap, which isn't that hard, but any quantifiable or subjective reports of improved performance is lacking.
My only experience using swap was using an openwrt router (with very limited resources) where it was vital for some stuff to function at all, but I couldn't see any general speed improvements, and when swap was used it was terribly slow.
Do you use swap or tried it, does it help? How much?
PremiumMediocre said:
Do you use swap or tried it, does it help? How much?
Click to expand...
Click to collapse
Apparently this is not something that interest people, but in case someone searches for swap and finds this post I can say it definitely helps with multitasking. Currently my phone uses over 100MB of swap space, and lags due to apps being terminated due to low memory is a more rare occurrence nowadays.
Just some interesting reading about this:
http://zerocredibility.wordpress.com/2009/08/24/why-android-swap-doesnt-make-sense/
http://android.stackexchange.com/questions/2310/how-will-a-swap-partition-file-affect-the-system
If you're still interested, read these two links. A bit old though, but the only difference might be that Google has put an effort into making Android's way of freeing memory better. In that case, from what they say, I'd say there's a chance that swap will increase your performance.
Thank you, I've been reading up on swap as well, and it's not completely clear cut.
From your first link the argument:
"Having swap actually prevents the native Android memory management scheme from activating. The system sees memory and doesn't distinguish between physical and virtual. It will therefore prefer swap over the native Android memory management scheme, and won’t activate the native scheme until swap is full."
I believe this is just plain inaccurate. Even if you set swappiness to 100 android will terminate apps without filling the swap space, and swap is never treated as plain ram as far as I know.
Some real benchmarks is sourly needed though.
PremiumMediocre said:
Thank you, I've been reading up on swap as well, and it's not completely clear cut.
From your first link the argument:
"Having swap actually prevents the native Android memory management scheme from activating. The system sees memory and doesn't distinguish between physical and virtual. It will therefore prefer swap over the native Android memory management scheme, and won’t activate the native scheme until swap is full."
I believe this is just plain inaccurate. Even if you set swappiness to 100 android will terminate apps without filling the swap space, and swap is never treated as plain ram as far as I know.
Some real benchmarks is sourly needed though.
Click to expand...
Click to collapse
I tried to find done benchmarks, but it seems like there are none...
And like I said, old links so Google might have done something about the issues they're talking about
Sent from my Incredible S using xda app-developers app
Also have a look in the desire Z section for this. They only have 512mb ram (we have 768) so they are always looking for ways to free up ram
There is a lot of discussion about swap so have a look there They might know a lot more compared with us
markj338 said:
Also have a look in the desire Z section for this. They only have 512mb ram (we have 768) so they are always looking for ways to free up ram
There is a lot of discussion about swap so have a look there They might know a lot more compared with us
Click to expand...
Click to collapse
I think the speed of the processor is also important in this context since the native way to save memory is letting programs recreate the last state they were in before they were shut down. A fast processor would make swap less attractive.
In case you anyone wants to try, I'm using the Hunterwu kernel and used swapper 2 to activate the swap partition. The only hang up setting it up was that swapper 2 identified the wrong partition as swap but that could be manually changed.
PremiumMediocre said:
I think the speed of the processor is also important in this context since the native way to save memory is letting programs recreate the last state they were in before they were shut down. A fast processor would make swap less attractive.
In case you anyone wants to try, I'm using the Hunterwu kernel and used swapper 2 to activate the swap partition. The only hang up setting it up was that swapper 2 identified the wrong partition as swap but that could be manually changed.
Click to expand...
Click to collapse
Tell us if its any better, I might do the same

[TUTORIAL] Compcache and Swap

my 2c about compcache (now "zram") and swap
Both compcache and swap are used to improve performance AND maximum number of open apps.
1)How they work:
swap is the classic way to "increase" ram on a system.
Swap is a space on a non volatile memory (="not ram") where unused ram data are parked instead of being deleted.
Swap wears(and kills) memories it is put on. It is an heavy access file. Sdcards don't like it. They are not full-featured SSD Disks. Think of your photographs
Compcache is the new way to "increase" ram on a system,
compcache :
-reserves a part of you ram (cache),
-then it looks for unused data sitting on remaining, "real", ram,
-compresses these unused data (with a very primitive,loseless, algorithm) and
- send them to its cache OR to swapfile.
Compcache's trick works well when you have lots of higly,easily, compressable data in your ram. Text is higly compressable, an executable is less compressable.
1a)
-if, after compression , data are still "big" (compressed data > original data /2), then compcache sends compressed data to swap, not to cache.
-and when compcache is full, unused compressed data are sent to swap.
2) because of compression involved, compcache uses more cpu cycles than classic swap.
3) settings of both depends on
-hardware specs of the system.
-use of the system
4) compcache+swap is better than swap alone if your ram is filled with EASILY compressable data.
4a)Remember point 1a : compcache has a simple compression algorithm, and ALWAYS first compresses data.
AFTER COMPRESSION it decides if keeping them in cache or sending them to swap. This means that
if compcache has always to work with not compressable data, it will compress them AND send to swap. this means double work: compression AND swap access.
4b) First practical conclusion :
compcache is useful for people using LOTS of text-intensive apps (forums, webpages, docs, facebook)
compcache may be useful in apps using SIMPLE still images (some games, driving assistant)
compcache is useless in multimedia activity (watching youtube, movies, photographs, listening to mp3s, playing some other games.)
5) The swap file.
As told at the beginning, swap, both improve performance(=speed) AND number of apps simultaneously open.
Lets' take a look to the PERFORMANCE thing.
5a)On "classical" (fragmented, not-SSD hard disk) systems, a swap file is always faster than retrieving datas from original disk locations. EVEN IF the swap file is on the same disk where original datas are.
This happens mainly because :
5a1)-data in swap file are less fragmented, needing less seek time.
5a2)-swap file is usually put in the external (=fast) zone of an hard disk,
5b)On SSD systems (phones included) 5a1 and 5a2 are not true, and a swapfile is USELESS IN IMPROVING PERFORMANCE EACH TIME THAT it is keeping data which are already present on its same phisycal memory.
Examples :
5b1)opera browser executable is on phone memory; but Opera-cached-webpages have been moved on sdcard via app2sd.
In this situation a swap file on sdcard is obviously useless to improve internet browsing with Opera.
5b2) i use apps (facebook, Whatsapp) which DON'T have a good caching of their own. Swap could be useful: it could avoid re-downloading data from the internet.
Now, the INCREASE MAXIMUM NUMBER OF OPEN APPS argument.
This is always true.
So:
5c)swapfile on SSD speeds up multitasking ONLY IF you use apps that
-badly manage (or don't have) a cache of their own.
-don't like force closing
Since this seems to happen very often to android apps, a swapfile is useful.
5c1)Swapfile could speed multitasking also IF an app's well-designed-cache is on a media WAY SLOWER than swapfile (but this is not LG O2x situation: it has a class10 internal memory).
So, my 2 cents about "increasing" RAM in LG O2X is :
-leave apps on phone memory, and put swap on a class10 sdcard.
-enable compcache only if you use lots of text-rich apps.
First: I think this doesn't really fit into the development section.
Then: I can't second the post you made.
mercxda said:
Both compcache and swap are used to improve performance AND maximum number of open apps.
(...)
As told at the beginning, swap, both improve performance(=speed) AND number of apps simultaneously open.
Click to expand...
Click to collapse
zRAM does NOT improve the speed of your device. Everything that's in the reserved zram storage will get compressed and decompressed, which takes some time (and cpu).
Swap is performing even worse. Instead of the fast RAM or the semi-fast compressed zRAM usage it's swapping onto the slow SD.
Sure, you can increase the maximum number of open apps, but the price is a lower performance.
So you're probably just meaning multitasking performance.
But still I can't agree to your conclusion:
mercxda said:
So, my 2 cents about "increasing" RAM in LG O2X is :
-leave apps on phone memory, and put swap on a class10 sdcard.
-enable compcache only if you use lots of text-rich apps.
Click to expand...
Click to collapse
As I wrote above zRAM is way faster than swap. So zRAM should be the first choice if you're running into low RAM situations.
If you still need more go and enable swap as well.
Last but not least:
Why are you talking about compache all the time? It's called zram nowadays, so call it that way.
tonyp said:
First: I think this doesn't really fit into the development section.
Click to expand...
Click to collapse
First : thanks for your interest in this post . I partially agree with you: this post is on the borderline beetwen Q&A and Development, because swap is not a development matter, it's standard unix's way of working.
On the other side zram's use,way of working, and even its inclusion (or not) itself in default installs, is still under development.
https://lists.ubuntu.com/archives/ubuntu-devel-discuss/2012-December/014122.html
Sure, x86/x64 is not ARM. And CM is not ubuntu.
Then: I can't second the post you made.
zRAM does NOT improve the speed of your device. Everything that's in the reserved zram storage will get compressed and decompressed, which takes some time (and cpu).
Swap is performing even worse. Instead of the fast RAM or the semi-fast compressed zRAM usage it's swapping onto the slow SD.
Sure, you can increase the maximum number of open apps, but the price is a lower performance.
So you're probably just meaning multitasking performance.
Click to expand...
Click to collapse
I, again , partially agree, i was fundamentally talking about multitasking performance. And sure, zram takes cpu cycles... I reserved a full, standalone point to say that.
But
i wouldn't be so sure about one being better than the other. My arguments are in the original post.
As I wrote above zRAM is way faster than swap. So zRAM should be the first choice if you're running into low RAM situations.
If you still need more go and enable swap as well.
Click to expand...
Click to collapse
As I wrote, and argumented, before, compcache/zram is way faster in a way limited range of situations.
Last but not least:
Why are you talking about compache all the time? It's called zram nowadays, so call it that way.
Click to expand...
Click to collapse
Because
1) I'm an old cat.
2) "Compcache" is a well chosen autodescriptive term.
3) It's been "compcache" for over 4/5 of it's life, and, well...
4) I'm an old cat. ;D
Have fun, and thanks for all your work in O2x developing.

System Ram Usage

It is normal that the system use about 2 gb of ram??
Here is the attachment
I'm on latest stock and not rooted
And i have a lot of user apps does this affect the ram used by system?
Kind of, sort of normal.
The phone is configured for maximum number of apps running at the same time, not for maximum size of usable memory. I think the limit is 32,but that depends on the rom you are running. So if the memory footprint of your apps is small, you end up with unused memory.
The justification I heard from the devs is that it's more battery friendly this way. If you want my opinion: they chose to go overkill with 6 GB RAM, but maybe they got a good deal from their supplier. Anyway, there's no harm, and the phone is more future proof this way.

Categories

Resources