For browsing, office apps, games and multitasking, is ordinary swap enough? Would zram or a RAM disk help?
Is regular swap enough for everyday use, or do I need zram too?
Answers
Usually, ordinary swap is enough. If you have plenty of RAM for what you run, you might rarely use it. Swap gives the system somewhere to put memory pages when RAM is under pressure, but disk swap is much slower than RAM, so it won't make up for a serious RAM shortage.
There's no single swap size that suits every machine. It depends on your RAM, workload and whether you want hibernation. Hibernation generally needs suitable disk-backed swap with enough space for the saved memory image. Zram alone doesn't preserve that image when the machine powers off.
Reply to this answer
Zram is usually another kind of swap, not a separate requirement. It stores compressed pages in RAM, which can help a low-memory machine keep more data in memory before falling back to disk. Compression takes CPU time, and zram still uses RAM, so it isn't free extra memory.
You can use zram alongside a swap file or partition. Which gets used first depends on swap priorities. Whether that helps depends on the workload and how much memory the machine has.
Reply to this answer
A RAM disk is different. It's storage made from RAM, not a disk on the hard drive, and you don't need one for normal desktop use. It takes memory that your apps could otherwise use.
I'd only set one up for a specific temporary storage task where the speed is useful and losing the contents on shutdown is acceptable.
Reply to this answer
No swap at all can be reasonable if you have enough RAM and don't need hibernation, but it leaves less room for an unexpected memory spike. If the system runs out of usable memory, applications may be killed rather than getting more time to release memory.
For a useful recommendation, the missing details are how much RAM you have, what storage the machine uses, and whether you've actually noticed slowdowns or memory-related errors.
Reply to this answer
Add your answer
Answers are reviewed before publication.
8v~bitweave_304:
Also, the configured zram device size isn't the same as the physical RAM it will consume. That depends on how well the stored data compresses.