Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> It solves the problem that a e.g. browser eats all your memory.

It doesn't solve that. You get a little bit more headroom, but that's it. Not much ram is considered compressible anyway. On my Mac I'm barely reaching 10% of compressed memory anyway, so it doesn't make that much difference.



Current RAM usage from my Windows 10 dev machine, as reported by Task Manager:

> In use: 18028 MB

> In use, compressed: 2718 MB

> Compressed memory stores an estimated 9013 MB of data, saving the system 6294 MB of memory.

That's not a small amount.


My experience is that zram saves quite a bit. I have another old laptop with 4GB where it's essential. Maybe it differs by program type?

  NAME       ALGORITHM DISKSIZE  DATA  COMPR TOTAL STREAMS MOUNTPOINT
  /dev/zram0 lzo-rle      15,6G  1,9G 248,6M  418M      16 [SWAP]


Yup, it will depend on your workload a lot. Worth testing of course!


> Not much ram is considered compressible anyway.

What are you basing this on? Things in RAM are often very very compressible, usually between 3:1 and 4:1.


Depends on what things are in your ram. Code/configuration/simple data structures compress nicely. Images/videos/ML-models don't.


> Depends on what things are in your ram.

No offense, but you are being a very precise in defense but very broad in your (in general incorrect) claim.

The representation of an image sitting in memory will be a bitmap array, and for sure that will compress quite well. Video data as well but any decompressed frames are so transient I agree they won't benefit. ML-models don't compress well, but training data certainly does.

If you put aside mapping already compressed or non-compressable data into memory, all the rest of the things ram is used for can be compressed. Day to day you will have a lot of memory allocated that can be compressed. Most memory in use right now on most computers is compressible.


yes, it's not the ultimate solution but if your machine behaves in 98% of cases snappy and does not slow down vs. let's say only 70% of cases then that's a huge usability difference. Sometimes you just need a little headroom on top and not more. As some user point out it really depends on the workload and data etc. Browsers are a good example because in my experience browser cache can be compressed quite good.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: