logoalt Hacker News

bagxrvxpepznyesterday at 10:31 PM1 replyview on HN

> I've never understood the fascination some people have with mmap.

Uncommonly used system calls give user-space programmers the sensation of learning something.

> Why would you want the kernel to do these things for you? It'll do a worse job: it has less information than you do and has to use blunt heuristics that work sort-of-good-enough for the whole world, not just your program.

Yes, you're opting into non-determinism you don't control. When resources get constrained and everything can't be in memory and someone asks you why the database sucks, all you'll be able to do is shrug. Anyone who builds critical systems would never rely on the kernel making decisions like this. Don't use LMDB for anything that matters.


Replies

jnwatsontoday at 12:06 AM

You're already depending on the OS for many other things. Depending on it for page caching is just one more thing.

show 1 reply