Hacker News new | ask | show | jobs
by netbsdusers 8 days ago
The principle of a paging system is that main memory is just a cache for secondary memory, and the concept of "free memory" ideally rather means something like "memory that can be quickly reclaimed for another purpose". Sometimes anonymous memory will be of less us occupying main memory at some given time than would be letting cached file contents take their place.
1 comments

You've described what the purpose of a swapfile is – thanks? My argument is simply that you don't need a swapfile with enough real memory; that swapfiles can unnecessarily shorten the lives of SSDs, entirely unnecessarily.

----

>I have 20GB of RAM free (me)

>>~need to have quick access to main memory

>I have 20GB of RAM free (still me)

>>~yeah but "quickly reclaimed for another purpose"

>I have 20GB of RAM free (!m!e!)

//of//32GB//ttl//

----

In linuxland, I'd just type `sudo swapoff -a` and be done with it. That machine has 96GB of RAM, so it would have ~84GB of RAM free (if, hypothetically, the same hardare/configuration were operating that system).

Does. not. need. a swapfile.

The operating system, during bootup, should think "hey I have dozens of gigabytes of RAM, won't be needing any swapfiles" – behind the scenes and without input.