Use zram to reduce the memory of program

zram is a driver in linux kernel. It compress the content in memory to reduce the pages used by application.

But that’s not the only way we could use zram. Furthermore, we could use zram with tcmalloc to reduce user application’s cost of memory.

Now we make redis-server to use memory in zram. If we use “lsof” to check the redis-server, it will show:

That’s the file created by tcmalloc library, and it has already be compressed.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.