# Is it good idea to use ZRAM on a old laptop?

## Goshanecr

Good day friends!

I have a laptop with Intel Pentium-M 1.6Ghz processor and 256MB RAM. I want to ask you, since I read that using ZRAM allow virtually extend availaible high-speed memory to system. And I want to consult with yours, is it will be useful for my hardware? If yes, how much RAM I need to use as ZRAM swap?

My typical environments are: LXDE+Epiphany+Audacious+Pidgin.

----------

## eccerr0r

Zram is a compressed ramdisk.

Really only you can tell.  How much swap do you use?

One problem is though regular disk swap, swaps to disk which is disjoint from the shared resource.  Zram will use even more RAM.  The hope is that swapped pages are highly compressible, if it is then it would be a benefit (minus CPU cycles, especially on a single core CPU like the Pentium-M.  On a properly working DMA system your system can continue to compute other stuff when waiting for disk if you're multitasking, but now has to be used for compression for zdisk.)

I don't think it should be too hard to just try it!  Let us know.  I might try it on some of my ram limited machines, perhaps my 64MB SC520 SBC could benefit... then again it has even less CPU to work with...

----------

## szatox

 *Quote:*   

>  256MB RAM. 

  well, first thing is you definitelly want to get rid of CPU hungry programs.

Second, ramdisk only takes as much data as it contains rather than what it is allowed to take. Why not give it like 90% and set swappines to, say, 10-20 instead of default 50? It's a guess rather than a silver bullet, but lower swappines will keep more data in uncompressed RAM, while non-zero value should still push it out to ZRAM before you atualy run out of space.

As you consume more and more RAM, more and more of it will go to ZRAM growing your SWAP (and reducing available RAM pushing more data out to ZRAM) in turn degrading performance, possibly slowing you to crawl. Give it a try and look at behaviour  :Smile: 

On the bright side, under "typical" desktop workload CPU is doing nothing most of te time and decompression is signifficantly faster than compression, so if you use some data that doesn't change frequently it can stay in swap for a long time with little impact on performance.

----------

## eccerr0r

But you do have to watch out, running emerge --update world could benefit more from real RAM than zram swap...

Maybe try to first find out how much you typically go into swap, add a little fudge factor, divide that by three, and use that number as a starting point for your zram swap.  And keep some regular swap in case it overflows...

----------

## Goshanecr

Finally I can tell that zRam on a laptop with Pentium-m 1.6Ghz + 256MB Ram is a very, fantastic solution!

All tasks which I have on it (php, lighttpd, mysql, browser, updating @world) are much responsive. Because just one browser often eats all ram and swapping freezes system, but now such effect is gone.

----------

## mv

 *Goshanecr wrote:*   

> Finally I can tell that zRam on a laptop with Pentium-m 1.6Ghz + 256MB Ram is a very, fantastic solution!

 

Mind to share your configuration? (E.g. how much ram have you reserved, which compression algorithm have you chosen)?

----------

