4 ms·
Assuming that OP is correct in everything, it isn't shown anywhere that swap must reside in persistent storage. It could be stored in RAM, couldn't it? I mean y
by radisb 2y ago
Assuming that OP is correct in everything, it isn't shown anywhere that swap must reside in persistent storage. It could be stored in RAM, couldn't it? I mean you always have a fixed max amount of swap, so if it fits in memory , then why not put it in memory? But then why bother with swap?
- KaiserPro 2y ago> then why not put it in memory? But then why bother with swap? because ram is expensive compared to disk. Ram is normally fixed compared to disk by storing not-used but still needed pages on disk, allows for much greater performance with less resources. for example it allows a bigger VFS cache.
- radisb 2y agoSo hypothetically, if ram was as cheap and easy to add as storage, swap would not make sense?
- KaiserPro 2y agodepending on OS and upper limit, yeah RAM all the way. But I suspect the kernel doesn't think like that. I know that OSX does things differently, so perhaps there are better ways
- rwmj 2y agoIt can be, that's what zswap is all about.