2 ms·
Swap is a system level property not a program level property. They are similar, use similar mechanisms, but the experience that a user would see are very differ
by sitkack 4y ago
Swap is a system level property not a program level property. They are similar, use similar mechanisms, but the experience that a user would see are very different.
- chpatrick 4y agoI'm not sure it would be that different but mmap has the benefit that it can swap directly to the model file on the disk instead of making a copy in swap space.
- sitkack 4y agommap is like tightly scoped, targeted swap. If the PoR is on disk, the OS is free to reclaim that memory for something else at anytime. It really is a beautiful hack, but if you turn on swap for the system in that way, it has to balance memory usage across all the running programs. In this use of mmap, there is nothing to swap out as the source of truth is always on disk. During general swap usage, memory has to travel in both directions.