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

> Copy commands and even deletions can fail or take forever as memory tries to swap to a full disk

That's only a problem if your memory is full as well, and even then, I've never encountered a server that uses a swapfile instead of a swap partition.



Even a swap file shouldn't matter, since it's still not sparse. The one exception is if you're on a system that dynamically adds and removes swap files - I believe darwin does that, and I think it might be possible to do on Linux(?) but I've not actually seen it done.


Not quite the same situation as described in the article, but it is still possible for the kernel to swap memory in and out of disk even without a swap file/partition. Memory used for storing executable binaries is allowed to be moved out of memory, as a copy of it lives on disk. This means you can still encounter memory thrashing (and thus system unresponsiveness) under low memory situations.


> Memory used for storing executable binaries is allowed to be moved out of memory, as a copy of it lives on disk.

On Linux, this is not necessarily the case, as you can change the file on disk while the executable is running. I don't know if Linux just keeps executable code in memory all the time, or if it is smart enough to detect whether a copy of executable pages still lives on disk.


You should get a "text file busy" error if you try that.

What you can do is delete and then recreate the executable. Then the deleted data simply sticks around on disk until it's no longer referenced


That's also only a problem if your swap partition is mounted from a file on your filesystem, which is an exceedingly uncommon configuration.




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

Search: