Zram questions


Recommended Posts

I'm trying to understand the role of zram and having some difficulties with it. I've looked in several places and my understanding is this:

- It's a block device in RAM that uses compression

- It functions similar to swap

 

I notice that mine is set to about 2 Gb:

wurmfood@helios64:~$ cat /proc/swaps
Filename                                Type            Size            Used            Priority
/dev/zram0                              partition       1945084         0               5

 

My questions:

1. Does that mean 2 Gb of the device RAM is used for the zram swap device?

2. I can understand this on devices with slower storage, but would it be reasonable to disable this and instead use swap on an SSD?

Link to post
Share on other sites
  • wurmfood changed the title to Zram questions
Donate and support the project!

4 minutes ago, wurmfood said:

Does that mean 2 Gb of the device RAM is used for the zram swap device?

Yes.

4 minutes ago, wurmfood said:

but would it be reasonable to disable this and instead use swap on an SSD?

Also yes. Armbian by default uses 50% if available memory for zram. If you have a fast harddrive like SSD or NVMe attached it of course makes sense to put a common swap there.

Link to post
Share on other sites