Originally posted by jpp650
View Post
Announcement
Collapse
No announcement yet.
Ubuntu To Begin Making Use Of Swapfiles In Place Of SWAP Partitions
Collapse
X
-
Originally posted by Serafean View Post
Even though you read my mind for arguments, I don't have time for benchmarks do you? Does anyone?
LOL
- Likes 1
Comment
-
Originally posted by jpp650 View PostIf for whatever reason I need to page-out because of memory shortage, now I know that it will crawl even more if I use Ubuntu, thanks to having to cross the filesystem layer to reach the storage.
- Likes 6
Comment
-
Originally posted by patrakov View Post
No, it won't. When the swap file is activated, the kernel asks the filesystem: "which hdd sectors does this file map to?". Then, when it needs to read or write the swap file, the kernel never asks the filesystem layer and writes directly to those sectors.
- Likes 1
Comment
-
-
I see pros and cons to both sides. For those who like to micro-manage, a swap partition guarantees the position of the data on the disk. Being a separate partition, users can't tamper with it, and I'm assuming it runs as smoothly as possible; swap files could be hindered by the filesystem, but a partition dedicated toward swapping I'm sure is highly optimized. Meanwhile, a swap file is great because it's generally more user-friendly. You can more easily enable, disable, and resize it whenever you want.
Overall, I'm not a fan of swap/paging. Both Windows and Linux are crappy at dealing with it, for different reasons. In Linux, I like how the system won't use swap space unless you're out of RAM, but, doing this can seriously kill performance. If you happen to run out of both RAM and swap, Linux is rendered nearly useless. Meanwhile in Windows, you can have several GB of un-committed RAM and if your paging file is too small, it'll complain that you don't have enough memory. It'll utilize the swap whether you want it to or not. This is generally good if you happen to run out of RAM, but if you don't then it just needlessly slows things down and if you have an SSD, puts unnecessary write cycles on it. If you run out of RAM+swap space in Windows, applications just simply crash. That gets really annoying in terms of lost progress, but, I suppose it's better than losing everything.Last edited by schmidtbag; 16 December 2016, 01:27 PM.
- Likes 1
Comment
-
Originally posted by schmidtbag View PostOverall, I'm not a fan of swap/paging. Both Windows and Linux are crappy at dealing with it, for different reasons. In Linux, I like how the system won't use swap space unless you're out of RAM, but, doing this can seriously kill performance. If you happen to run out of both RAM and swap, Linux is rendered nearly useless. Meanwhile in Windows, you can have several GB of un-committed RAM and if your paging file is too small, it'll complain that you don't have enough memory. It'll utilize the swap whether you want it to or not. This is generally good if you happen to run out of RAM, but if you don't then it just needlessly slows things down and if you have an SSD, puts unnecessary write cycles on it. If you run out of RAM+swap space in Windows, applications just simply crash. That gets really annoying in terms of lost progress, but, I suppose it's better than losing everything.
Window's swap method works a whole lot better if you need the swap. Even before it needs swap it starts writing pages to swap without removing them from RAM, just in case it needs to swap them. This way when it comes down to a swap crunch it's already written to disk. It also swaps in hard drive friendly sequential multi-megabyte chunks. By contrast Linux has to sit there writing a few pages to swap, loading new programs to RAM, rinse repeat. On an old laptop that had a hard drive Linux would swap for minutes while Windows on the same machine, with about the same RAM load, actually ran really well but with a very painful application switch time. You didn't want to Alt-Tab. I'm not sure of the details but it felt like background GUI apps were being entirely written out to swap and their event queues just suspended. That was probably a great thing back in Windows 95 days, and it seemed to still work well for Windows XP. It probably can't be done in Linux without a lot more coordination between the kernel and the GUI. Android does a similar thing to Windows by forcing background apps to save state and exit.
And for the RAM+swap limit, you can run Linux that way too. It's one of the overcommit settings in /proc/sys. It's good for servers because instead of running out of memory in the middle of an operation and randomly killing something with the OOM killer, the software gets a failed memory allocation. Well-written server software handles this and just keeps running while rejecting new connections or queuing them up for later. Or it might decide to shut down, but it does it gracefully instead of dropping locks and half-written files everywhere.
- Likes 3
Comment
-
Originally posted by starshipeleven View PostI'm wondering if now swapfiles can handle hybernation too. I thought only swap partitions could handle that.
Sizing of the swap file will be to no more than 5% of the free disk space or 2GB, whichever is less.
- Likes 7
Comment
Comment