Compcache - Hero CDMA Q&A, Help & Troubleshooting

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

Related

Using NAND as RAM?

After many tests I think that we really suffer from a lack of RAM. But the internal memory (NAND) should be the same speed as RAM I think. So why we don't use another 128Mb of NAND as additional RAM? A sort of swap part, but used as RAM and not as normal swap....
If someone related to the kernel would answer is it possible or not, it would be good)
DiMiK said:
After many tests I think that we really suffer from a lack of RAM. But the internal memory (NAND) should be the same speed as RAM I think. So why we don't use another 128Mb of NAND as additional RAM? A sort of swap part, but used as RAM and not as normal swap....
If someone related to the kernel would answer is it possible or not, it would be good)
Click to expand...
Click to collapse
Using it as RAM would propably require major changes to the kernel if it is even possible which I doubt it is. Using it as swap would be the possible alternative and I pretty sure that is very possible and would help performance but at a cost.
1. You would either have very little left for system and data or you would have to put system and/or data on the SD-card and that alone may make you lose anything you gain from putting swap on NAND.
2. I actually asked the swap-on nand question myself and well, we can't replace our NAND, at least not easily and swap is I/O intensive and intesive I/O will sooner or later wear out the NAND. So basicly this is not a good alternative unless you want to turn your phone into a paperweight sooner than you had planned.
So what we can do is using compcache and/or swap on SD-card. The easiest thing is to just enable some compcache. It uses RAM as swap and uses compression on the contents so we can hold more things in RAM that we would usually be able to. This means Android can keep more apps in "sleep" allowing for faster switching between apps but it will also decrease the possible amount of available RAM for the active app. I usually turn on compcache with the default setting which is to use 25% of the RAM for compressed swap. It might be placebo but IMHO it feels a it "smoother" to use after that.
Another alternative is to use a swap partition in the sdcard. Just using swap means you do not need to load any compcache kernel modules and there is no compression taking place so it's a good alterantive. However you need know your way around partitioning SD-cards to get this running so it's not as easy as just enabling compcache (assuming the build supports compcache).
For the really advanced you can enable compcache with backing swap. It means it uses a certain amount of compressed swap i RAM and when it runs out of space there it starts putting stuff on the SD-card swap partition. Once again, a bit tricky to setup but may be the best alternative.
Read more about it here: http://wiki.cyanogenmod.com/index.php/Compcache
kallt_kaffe said:
I usually turn on compcache with the default setting which is to use 25% of the RAM for compressed swap. It might be placebo but IMHO it feels a it "smoother" to use after that.
Click to expand...
Click to collapse
It make good effect: more applications can run simultaneously.

Making g1 run faster? (10 mb hack)

Hi, I was wondering if I can use the 10 mb ram hack with my g1 with CM 6.0 RC2. I noticed most of the tutoriials are using 4.xx.xx so I wanted to ask before I do it. My phone is kind of slow even though it is overclocked at 576mhz and 64 mb class 6 memory swap. Thanks.
Ties0 said:
Hi, I was wondering if I can use the 10 mb ram hack with my g1 with CM 6.0 RC2. I noticed most of the tutoriials are using 4.xx.xx so I wanted to ask before I do it. My phone is kind of slow even though it is overclocked at 576mhz and 64 mb class 6 memory swap. Thanks.
Click to expand...
Click to collapse
There is no 10 mb hack and won't be. It is not possible with Froyo.
As indicated above there is no 10mb hack and there never will be.
I am currently using the latest nightly and it is super fast and stable. As fast as donut (no ****).
3D Gallery works perfectly and there have been a bunch of small cool features added to the nightly.
I highly recommend it.
Awesome work has been done by Cyanogen and Crew.
ok thanks for the reply guys. Is there any other way to make my rom faster? Thanks.
Ties0 said:
ok thanks for the reply guys. Is there any other way to make my rom faster? Thanks.
Click to expand...
Click to collapse
Of course reduce or remove swap,
android has it's own swap mechanism that causes little ram to actually be least recently used, thus if swap is enabled the phone will be constantly swapping it in/out!
In addition to reducing the life of the SD card its slow. I understand a very little bit of swap *may* allow some edge cases where a *little* more ram is needed or to offload something like launcher that may be configured to stay in ram to work faster.. however you can't forget the speed issue.
Try this enter console on your phone and run:
dd if=/dev/zero of=/sdcard/swapspeedtest bs=1048576 of=64
Note the time it takes, that is the time to write 64mb on a swap out operation.. if it seems too long to wait for a task its too much swap. 12mb is almost acceptable. I just stick to comp cache only. . Upped it from the default 12 to 15 MB since I had one or two tasks that just needed a tad more memory to play nice.
Also what is slow, returning to home? A particular app? I doubt its everything, usually its launcher and there are ways of locking it in home, upgrades to awd, and alternative launchers. These may help.
ezterry said:
Of course reduce or remove swap,
android has it's own swap mechanism that causes little ram to actually be least used, thus if swap is enabled the phone will be constantly swapping it in/out
In addition to reducing the life of the SD card its slow. I understand a very little bit of swap to allow some edge cases where a little more ram is needed or to offload something like launcher that may be configured to stay in ram.. however you can't forget the speed issue.
Try this enter console on your phone and run:
dd if=/dev/zero of=/sdcard/swapspeedtest bs=1048576 of=64
Note the time it takes, that is the time to write 64mb on a swap out operation.. if it seems too long to wait for a task its too much swap. 12mb is almost acceptable. I just stick to comp cache only. . Upped it from the default 12 to 15 MB since I had one or two tasks that just needed a tad more memory yo play nice.
Also what is slow, returning to home? A particular app? I doubt its everything, usually its launcher and there are ways of locking it in home, upgrades to awd, and alternative launchers. These may help.
Click to expand...
Click to collapse
Thanks for the detailed response! I will try lowering the swap partition, I always thought it would be fast because of the class 6 speeds. Does putting all my apps on SD make it slow as well? Also, returning to home is the main lag I'm talking about as it takes quite a while to see my apps. Thank you!
ezterry said:
Of course reduce or remove swap,
android has it's own swap mechanism that causes little ram to actually be least used, thus if swap is enabled the phone will be constantly swapping it in/out
In addition to reducing the life of the SD card its slow. I understand a very little bit of swap to allow some edge cases where a little more ram is needed or to offload something like launcher that may be configured to stay in ram.. however you can't forget the speed issue.
Try this enter console on your phone and run:
dd if=/dev/zero of=/sdcard/swapspeedtest bs=1048576 of=64
Note the time it takes, that is the time to write 64mb on a swap out operation.. if it seems too long to wait for a task its too much swap. 12mb is almost acceptable. I just stick to comp cache only. . Upped it from the default 12 to 15 MB since I had one or two tasks that just needed a tad more memory yo play nice.
Also what is slow, returning to home? A particular app? I doubt its everything, usually its launcher and there are ways of locking it in home, upgrades to awd, and alternative launchers. These may help.
Click to expand...
Click to collapse
I have about 3-5 apps that I would like to be running at one time? Should I be using CompCache or Swap? Currently I am on SuperD 1.9.3 WGK. I have been reluctant to run Froyo roms because they are so much more memory hungry in my experiences. My current rom runs pretty fast with a 96mb swap. If I were to fun a Froyo rom, what can I do to be able to run the 3-5 apps and retain speed?
Ties0 said:
Thanks for the detailed response! I will try lowering the swap partition, I always thought it would be fast because of the class 6 speeds. Does putting all my apps on SD make it slow as well? Also, returning to home is the main lag I'm talking about as it takes quite a while to see my apps. Thank you!
Click to expand...
Click to collapse
If you are using BOTH SWAP & have applications installed to the sdcard, then it will ****REALLY**** be slow.
With just applications on the sdcard, your speed should be fine.
Ties0 said:
Also, returning to home is the main lag I'm talking about as it takes quite a while to see my apps. Thank you!
Click to expand...
Click to collapse
This is a symptom of launcher being evicted from ram, try the stay in ram option in settings->adw launcher->system settings->system persistent in the more recent versions of adequate (I think included with rc2 if my memory serves me)
It may not be perfect as it will still get killed if a very large application is loaded.
Either you need a launcher that behaves as a good android application, and can quickly reload it's last state, even if it was not in ram when you requested it.. or launcher needs to be considered outside the usual android memory management and to be kept in ram.
These persistent processes are where you may depending on your usage of the phone find comp cache or swap in low amounts (32mb combined is probably the absolute max) may help as they will have allocated ram that is rarely used and not automatically freed as they are persistent..
ezterry said:
This is a symptom of launcher being evicted from ram, try the stay in ram option in settings->adw launcher->system settings->system persistent in the more recent versions of adequate (I think included with rc2 if my memory serves me)
It may not be perfect as it will still get killed if a very large application is loaded.
Either you need a launcher that behaves as a good android application, and can quickly reload it's last state, even if it was not in ram when you requested it.. or launcher needs to be considered outside the usual android memory management and to be kept in ram.
These persistent processes are where you may depending on your usage of the phone find comp cache or swap in low amounts (32mb combined is probably the absolute max) may help as they will have allocated ram that is rarely used and not automatically freed as they are persistent..
Click to expand...
Click to collapse
Thanks for the detailed response! I just changed the adw launcher and deleted my swap partition... It seems to be much slower when pressing home (icons are taking a while to load) so I might just use 32 mb for swap.
EDIT: question, what exactly does ext4 do? I know swap is like external ram, but what does ext4/ext3/etc exactly do? and how much should I put in? I tried googling but could not find the answer. Thanks!
Ties0 said:
EDIT: question, what exactly does ext4 do? I know swap is like external ram, but what does ext4/ext3/etc exactly do? and how much should I put in? I tried googling but could not find the answer. Thanks!
Click to expand...
Click to collapse
On CM6, nothing. On CM 4 & 5, it was used for Apps2Ext (formerly known as Apps2SD - before Google came out with their own flavor). However, CM6 does not have Apps2Ext. It has been indicated that it will be targeted for 6.1.

512Mb RAM - Getting it out ?

I have a Flash application that requires ~130Mb of RAM and I want to run it on my Galaxy S
I've installed Froyo JPK with latest flash 10.1, but just before the end of startup procedure I always get the "exclamation circle" icon which is apparently the "out-of-memory" message in flash.
I have tried to free up the memory with task killers and memory boster, but can't get it above 175 Mb, which is obviously still not enough, since probably browser and other applications/services use it back before the flash application starts completely. Or might be also some limitation my browser in Galaxy S ? -> see EDIT below
On HTC Desire this same application works like a charm.
So I wonder...
Is there any way to get more free memory ? [EDIT: Yes, with "Chuck Norris mode" app killers, but i does not always help and it's lame]
Is there any way to get more than 311-322Mb RAM used for Applications ? [EDIT: Yes, when developpers will found out the way how to get less memory used for video codecs or even found the misterious 32Mb which are yet nowhere to be found]
Can we expect to this memory issue to be solved in future Froyo releases ? [probably only Samsung knows that, but for now it seems very unlikely]
EDIT: Found out that I get out-of-memory with every single application when it reaches 128Mb of RAM usage.
This is again specific to SGS. Looks like this is some internal max memory allocation size per application/VM
So here is another question:
Is there any way to increase this limit (might be android internal or dalvik VM related)?
no
no
no
sorry to say that...
flypubec said:
I have a Flash application that requires ~130Mb of RAM and I want to run it on my Galaxy S
I've installed Froyo JPK with latest flash 10.1, but just before the end of startup procedure I always get the "exclamation circle" icon which is apparently the "out-of-memory" message in flash.
I have tried to free up the memory with task killers and memory boster, but can't get it above 175 Mb, which is obviously still not enough, since probably browser and other applications/services use it back before the flash application starts completely. Or might be also some limitation my browser in Galaxy S ?
On HTC Desire this same application works like a charm.
So I wonder...
Is there any way to get more free memory ?
Is there any way to get more than 309Mb RAM used for Applications ?
Can we expect to this memory issue to be solved in future Froyo releases ?
Click to expand...
Click to collapse
If you need that amount of memory you should use a computer.
Its not the phone thats the probem here. its what you try to run.
//Damian
I would personally put up money to get the RAM issue resolved.
People keep saying that 324~ MB is enough. That's not the point though. The point is that Samsung advertised 512MB. Any reasonable person would assume that, like other phones containing 512MB of RAM, that the phone would have 400+MB available for general usage. 324 MB for such a power phone is dismal. I consider Samsung's claim to be a form of false advertising. Yes, technically the phone has 512MB of RAM, but not according to the reasonable expectations of a consumer. Almost half of the stated RAM isn't usable to the end user for applications. This is a problem with the phone from the standpoint of delivering the expected value to the consumer.
Dear XDA Developer Legends,
Do you think it is possible that you will be able to free up ram that is allocated to the ram disk?
Yours,
Concerned Customers
Hm, maybe its applicable for a lawsuit?
andars05 said:
I would personally put up money to get the RAM issue resolved.
People keep saying that 324~ MB is enough. That's not the point though. The point is that Samsung advertised 512MB. Any reasonable person would assume that, like other phones containing 512MB of RAM, that the phone would have 400+MB available for general usage. 324 MB for such a power phone is dismal. I consider Samsung's claim to be a form of false advertising. Yes, technically the phone has 512MB of RAM, but not according to the reasonable expectations of a consumer. Almost half of the stated RAM isn't usable to the end user for applications. This is a problem with the phone from the standpoint of delivering the expected value to the consumer.
Click to expand...
Click to collapse
the phone has 512MB and you can use all. But the system use some of it.
Its only user that cant read and understand how it work hat keep asking about it.
And this phone has more ram that most have. So yes it is enough of ram.
'If you try to runt 50+ all time you will and up with low memory.
But its the same on a computer. none complain about that.
Only that you can only see 3.5GB on windows and use that on a 32.bit system. Well now you can see 4GB and all people are happy.. but they still cant use it, but its looks good.
That the same with this phone.
If samsung did show 512MB and did show how much that was free, all people that complain would be happy. but it dont change a bit what thay can use.
yaocheng said:
no
no
no
sorry to say that...
Click to expand...
Click to collapse
That make no sense
there is no reason to get less memory with the i9000 when comparable devices like the nexus one running the same OS version has 100mb+ more free ram
DamianGto said:
the phone has 512MB and you can use all. But the system use some of it.
Its only user that cant read and understand how it work hat keep asking about it.
And this phone has more ram that most have. So yes it is enough of ram.
'If you try to runt 50+ all time you will and up with low memory.
But its the same on a computer. none complain about that.
Only that you can only see 3.5GB on windows and use that on a 32.bit system. Well now you can see 4GB and all people are happy.. but they still cant use it, but its looks good.
That the same with this phone.
If samsung did show 512MB and did show how much that was free, all people that complain would be happy. but it dont change a bit what thay can use.
Click to expand...
Click to collapse
This misses the point of my original statement. The Nexus One is advertised (along with many other phones) as having 512MB of RAM. The N1 has 380-400+MB available of RAM available for applications, as do many other phones containing 512MB of RAM.
Yes, the system does reserve some for certain system functions. Even after those functions have been reserved on other 512MB models, the vast majority is still available to the end user. This is not the case on the Galaxy S series. This is evident by the original posters comment regarding his application.
To address your Windows example: Windows 32 bit actually states that only a portion of the 4GB is available for use. I don't see in the advertisements where Samsung states "Contains 512MB -- 324MB available for actual usage"
I think most consumers, like myself, would assume that the amount of RAM advertised is directly correlated to the amount usable for applications.
Otherwise, what's the difference between a phone advertised as having 384MB and the Galaxy S? They both could have the same amount of RAM available.
andars05 said:
Windows 32 bit actually states that only a portion of the 4GB is available for use.
Click to expand...
Click to collapse
But its not the case here.
+1 for the rest.
This is what i get if I run top command from adb from a freshly booted phone:
←[H←[JMem: 296300K used, 15048K free, 0K shrd, 6968K buff, 134720K cached
CPU: 1.3% usr 2.3% sys 0.0% nic 96.2% idle 0.0% io 0.0% irq 0.0% sirq
Load average: 0.99 1.33 0.59 1/351 3109
Wonder what this "cached" means.
Can somebody pls run this on HTC desire ?
I don't think our phone has 512mb of RAM physically available to the system. I think the phone has 512mb of RAM in total but it looks like 128mb of it is graphics RAM or something. Meaning we only have 384mb available to the system. The maximum amount of RAM I can ever get free is about 175mb so I don't think that it's reasonable that the system is using about 337mb of RAM. My desktop linux system uses less RAM than that on boot.
Isn't the memory allocation for graphics dynamic?
how often does the graphics really need all that ram?
any why aren't other devices affected by this? (doesn't the GPU on nexus or milestone for example need memory allocated?)
sionyboy said:
Do you think it is possible that you will be able to free up ram that is allocated to the ram disk?
Click to expand...
Click to collapse
Please explain. Which ram disk do you mean?
Also, since it runs on linux, cant we assign some space from the internal sd (or external) to make a virtual ram disk that would be used as ram when needed? some king a paging file that we know on windows...
And if this is possible, can we assign it to video so graphism will be a little slower but app will become faster?
I think there is something we can do if we can change assignation of ram, apps, and video to make this phone way much powerful.
(just an idea...)
franklin01 said:
Also, since it runs on linux, cant we assign some space from the internal sd (or external) to make a virtual ram disk that would be used as ram when needed? some king a paging file that we know on windows...
And if this is possible, can we assign it to video so graphism will be a little slower but app will become faster?
I think there is something we can do if we can change assignation of ram, apps, and video to make this phone way much powerful.
(just an idea...)
Click to expand...
Click to collapse
There's always Compcache..that worked like a charm on the G1 and Magic.
http://forum.xda-developers.com/showthread.php?t=724960
As you can see, all other Android phones reserve some memory to the system... It's just the way it is.
the sgs kernel creates amemory blackhole, that is, it starts using memory after a certain memory address.
It does that because many things in the hardware are using fixed memory addresses to allocate their own memory which is not managed by the kernel itself and the kernel will never touch or see it.
what you call "system memory" is usually memory used and seen by the kernel, for the OS's functionality: various applications, services, daemons, kernel daemons, kernel memory itself (its not much) and some time some ramdisks.
Every phone also uses that of course, which amounts for like 80-130megs. They also often use small black holes of like a couple of megs, but that's so little that no one will notice.
The sgs makes a big blackhole. To me it's more of a design fault, but not much you can do about it I guess. It would need someone who's going to read the complete hardware sheets to bypass that, if at all possible, lol. Or samsung.
I bet they fixed the design issue in the galaxy tab and either the chip has separate dedicated memory either there's no blackhole.
Another theory why the blackhole is necessary is that there's a bug in the chip and it's messing up a portion of the memory, so this portion is left unused (blackhole'd - never seen by the kernel) for stability reasons.
i hope this gives some insight.
reference from the previously linked post:
- Galaxy S [2.1] RAM = 512 MiB | Linux = 325 MiB | Reserved = 187 MiB (with I9000XWJM2 firmware)
notice the huge black hole here (187 megs)
I used to have more than 300mb free after reboot with nexus one...
DamianGto said:
the phone has 512MB and you can use all. But the system use some of it.
Its only user that cant read and understand how it work hat keep asking about it.
Click to expand...
Click to collapse
No, *we* can't use it all , because we != system. The debate is not whether or not there is 512MB of physical memory; there could be , since Samsung advertises as having 512MB, but its not all user accessible memory. We don't know for what the system is utilizing that memory, I don't think its for loading some of the core system components; otherwise we should be left with more free RAM like other devices with 512MB of RAM (i.e Nexus One). Its more likely that 188MB is used by either the GPU and other hardware or as a Ram disk.
In contrast, other phones having 512MB of RAM don't use user allocated memory for system or hardware use (at least not the same way Samsung does). They are somehow handling it differently, maybe their GPU's and Other hardware software counterparts have dedicated memory. Whatever said, at the end of the day in the user's point of view, Galaxy S DOES NOT have 512MB of RAM as what we were all led to believe . That is pure deception !!
If they knew this was the case then they should have alerted this to the users. For-example a spec sheet for Samsung Fascinates says 512MB Flash/384MB RAM they should have advertised Galaxy S like that instead of lying through their teeth.

[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 ))

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