2 ms·
> Keep in mind that your whole linux system essentially mmaps your binaries / shared libraries when you run an application. And with caveats our world still kee
by asveikau 12y ago
> Keep in mind that your whole linux system essentially mmaps your binaries / shared libraries when you run an application. And with caveats our world still keeps going around.
Yes, and it does very admirable things there, brilliant things I would say. If you aren't going to touch the whole thing it doesn't have to load it from disk. If there is memory pressure it can just evict the in-memory copies of pages. All great stuff for that usage.
That said I have seen it cause issues. Most commonly I'd see it on Windows (it's not called mmap there, but whatever, same issue) if you run an app from a network share. Suddenly network timeouts make the whole app blow up. Not cool. There is actually a flag in the EXE file format that says "if you run this from a network, copy the contents to the pagefile first" - meant for exactly this scenario.