in reply to MLDBM and Memory

There are 2 layers here to understand. The first is MLDBM, and the second is GDBM_File.

What MLDBM does is take care of stringification and de-stringification of complex data structures. That is you read back a key/value pair, and then MLDBM turns that value to/from a nested Perl data structure. You could do the same thing that MLDBM does if you tied straight to GDBM_File and then used Storable to freeze/thaw your data after reading/before storing. If your datastructures for a single key/value get very large, this could be a problem. If they are not large, it isn't. If you're concerned by that, then you could look at DBM::Deep.

The real question is GDBM_File. That is a Perl interface between Perl and the GNU dbm implementation. That is the internal implementation that decides how much memory to read in, use, etc. You'll have to read the gdbm man-page to find out how it uses shared memory, etc. Odds are good that it uses some multi-level caching system, and caches in RAM. But I don't know anything about the size of those caches, how to tune it, etc. I don't know anything about that, but I'd guess that its memory use is relatively limited.

Another thing to try is that you could run it and watch memory usage with standard tools (like top and ps). That does not give a definitive answer, but it gives you a good idea of what the usage looks like.