Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

https://news.ycombinator.com/item?id=45007821

> Doesn't swap just delay the fundamental issue?

The fundamental issue here is what the linux fanboys literally think what killing a working process and most of the time the process[0] is a good solution for not solving the fundamental problem of memory allocation in the Linux kernel.

Availability of swap allows you to avoid malloc failure in a rare case your processes request more memory than physically (or 'physically', heh) present in the system. But in the mind of so called linux administrators even if a one byte of the swap would be used then the system would immediately crawl to a stop and never would recover itself. Why it always should be the worst and the most idiotic scenario instead of a sane 'needed 100MB more, got it - while some shit in the memory which wasn't accessed since the boot was swapped out - did the things it needed to do and freed that 100MB' is never explained by them.

[0] imagine a dedicated machine for *SQL server - which process would have the most memory usage on that system?



Indeed.

Also: When those processes that haven't been active since boot (and which may never be active again) are swapped out, more system RAM can become available for disk caching to help performance of things that are actively being used.

And that's... that's actually putting RAM to good use, instead of letting it sit idle. That's good.

(As many are always quick to point out: Swap can't fix a perpetual memory leak. But I don't think I've ever seen anyone claim that it could.)


What if I care more about the performance of things that aren't being used right now than the things that are? I'm sick of switching to my DAW and having to listen to my drive thrash when I try to play a (say) sampler I had loaded.


Just set swappiness to [say] 5, 2, 1, or even 0, and move on with your project with a system that is more reluctant to go into swap.

And maybe plan on getting more RAM.

(It's your system. You're allowed to tune it to fit your usage.)


Sounds like you just need more memory.


If I've got 128G of ram and need 100M more to get it, something is wrong.

What if I've got 64G of ram and 64G of swap and need the same amount of memory?


"Why it always should be the worst and the most idiotic scenario "

And no, if you need 100MB more then it's literally not important how much RAM do you have. You just needed 100MB more this time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: