To swap or not to swap, that is the question.

Just because I don't need or use swap personally, doesn't mean it's not useful in certain circumstances, if you regularly run a heavy load, if you compile software, if you open dozens of web browser tabs, if you create/manipulate video, hibernation on a laptop, etc, then it will be useful - but for an average desktop jockey such as myself, definitely not needed. :D

P.S If you check your ram usage, you will always find it caching data, for quick access.
 


It seems everyone thinks swap is "ONLY" for additional memory. They need to go back and read the OP.
Yes, that's what it is mainly for. But it is also used in laptop hibernation. This is where the current state of your computer is stored. But it sometimes used for "in-place" upgrades as a place to store things off the file system. It is also used as a holding place while some RAM applications "defrag"
themselves.

For example, ( this doesn't happen anymore with newer versions of Java ) 1.7 and older wanted your application
to run in contiguous memory. So lets say you had 4 GB of RAM, and your Java app took up 2GB. No problem right?
I have 3 GB of RAM free. But if it wasn't in contiguous memory space ( all one single RAM block ) it wouldn't load
because even though I had enough free RAM, it wasn't all together in a single block. It that case, it just used swap
as contiguous memory.

Also there are still a few old programs that want to load certain metadata in swap, they won't even let you run
the program unless you have a swap partition. They don't care if you have 120GB of RAM free. They won't run
without swap. Some RAM heavy applications ( Oracle databases comes to mind ) have there crash logs written
to swap by default, in case your system crashes due to running out of memory.

It mostly isn't used by anything anymore, unless you have a laptop that's sleeping, or you run out of memory.
But that's certainly not all it's used for.
 
It seems everyone thinks swap is "ONLY" for additional memory.

coughs

Not me! LOL I more or less understand what swap is used for.

I even have swap enabled, albeit with a swapfile and not a partition. If there's a performance hit, it's trivial on modern hardware. SSD speeds are quite high these days.
 
I always keep a swap partition even if the likelihood of using it is almost nil. ;)

There are reasons why you would want it. Not just for extra memory.

1699829191047.png
 
That always reminds me of the "double your ram" scams in the 90s...
Why does zram remind you have double your ram scams and I don't know what the double your ram scams are since I didn't know much about computers back then?
 

Members online


Top