Compcache is essentially a kernel module that provides a method by which swap space can be placed in the RAM of a system. Generally, swap space is space on a hard drive that the kernel of a system uses as a sort of “backup memory” when the system RAM begins to run out. On embedded systems, this is not generally desired, as it would cause a large number of writes to the device and shorten its lifespan. Compcache solves this problem.
Essentially, compcache blocks of a desired amount of RAM (in Sapphire, it's 20mb), and locks it as “swap space”. When the remaining RAM becomes full, the kernel will see that compcache is offering swap space, and pass some data to it, compcache then compresses that data and stores it back in RAM. This compression provides minor overhead, and essnetially allows for more than the original maximum memory amount to be stored in actual memory.
This is also ideal for android, as since many apps are quite small, several of them can easily be stored in a 20mb compcache before the swap space would become full as well.
Sapphire includes a script that makes managing compcache quite simple. Essentially from adb shell or some terminal emulator (with root, of course):
# load compcache and start it compcache on # stop and unload compcache compcache off # view compcache statistics (while loaded) compcache stats
Simple, no?
Compcache is not a project that I personally work on, so if you are interested in learning more, please visit their google code page, listed below: