mdbm uses a file-backed mmap region so you're implicitly saying you do want some sort of persistence. Also, mlock locks the heap in RAM to keep it from being swapped - mdbm's regions aren't heap space.
There's a mmap flag on Linux called MAP_LOCKED but I'm not sure how it behaves with MAP_SHARED, which mdbm uses (the man page isn't clear).
Comments
mdbm uses a file-backed mmap region so you're implicitly saying you do want some sort of persistence. Also, mlock locks the heap in RAM to keep it from being swapped - mdbm's regions aren't heap space.
There's a mmap flag on Linux called MAP_LOCKED but I'm not sure how it behaves with MAP_SHARED, which mdbm uses (the man page isn't clear).