Just to better understand my system. ZRAM moves some swap disk over to a portion of the ram. Let's take a specific scenario I went through and see how it would behave.
I have 16GB of ram. I developed a Vapoursynth video editing script to denoise 5K videos footage. To run it and re-encode with 16GB of ram, I need to downscale the video for some of the passes to barely fit into my ram. If I set it just a bit higher, the performance goes down to a crawl as it scratches onto the disk.
Now, with ZRAM, there is less ram available, but there is faster swap available........ so what will happen with the exact same script?
I guess one way to find out is to run it, but I haven't set that up yet.
Discaimer: I'm just guessing and do not really know.
I would expect an improvement, but how big is hard to tell as it depends on many factors.
Most important should be how much data can be swapped and hence get compressed in ZRAM, and how good does it compress with the selected algorithm. This indicates 2:1 compression, some report even 4:1 (do they brag? I don't know), but could also be lower in practice.
In my case, the few times I looked at RAM usage I seen roughly half the installed memory used for ZRAM but I failed to understand the compression ratio. It means jack though, as I have much less installed memory (3.8 GB) and a much lower and different workload.
I guess the best way to know is indeed to try, and see how much less downscaling you can get away with. It would be interesting to see how much ZRAM helps with such a workload, considering it's both CPU and memory heavy.
I know too little to advise anything, but I'd also expect some further improvement fine-tuning the size and compression algorithm for the machine and workload, but that's way beyond my knowledge. There's something about it on the Arch wiki -- of course. Interestingly, it can be configured without having to reboot.
My bet is it would allow for somewhere between 1.1 and 1.4 times the resolution before swapping to disk, and possibly degrade more gracefully when close to the edge.
Figures pulled out of thin air, taking a wild guess that (averaging compression ratio and ZRAM usage ratio) it would double how much data fits in memory.
It might help in the case that I'm stretching the RAM to its limit before the computer burst in flames (if I accidentally open another script preview, it stutters and then hard resets). Not mentioning the heat because the GPU runs at full spin too... to output a mere 0.7fps.
In cases that aren't so extreme but CPU-intensive, then what is the CPU cost of ZRAM? Let's say you're encoding 8K video footage with x265. ZRAM takes some CPU; but also makes more memory available for cache. Video cache is important for video processing.
I'd be curious of that encoding test with or without ZRAM. I'm sure some have done such benchmarks somewhere?
It is the RAM that is compressed, not the content. I'm not exactly sure what voodoo ZRAM does in the background. The real advantage of this is the "swap" happens in the RAM instead of the slow storage device such as the SSD/HDD/EMMC.
Android is the OS that is very well known for using ZRAM system.
You lost me right there. Only thing I can think of; I heard some alien races have spaceships that look smaller from the outside, say, 100m wide, but when you walk inside, the ship is actually a lot bigger. Is what what you're referring to?