[LG Optimus 2x] mercxda:
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.