Company
Date Published
Author
MongoDB
Word count
185
Language
English
Hacker News points
None

Summary

MongoDB uses memory-mapped files to access data, resulting in large numbers displayed when monitoring process resources like top. The virtual size parameter shows the total amount of mapped datafile, while resident bytes indicate how much data is cached in RAM. Larger data files lead to higher vmsize for the mongod process. If other processes require more RAM, the operating system's virtual memory manager may release some memory from the cache, reducing resident bytes on the mongod process. The inherent memory footprint of MongoDB can be estimated by starting a fresh instance with no connections and an empty /data/db directory, observing the resident bytes. Running with the –nojni option reduces core memory usage, and future improvements will further minimize this effect.