MongoDB isn’t a write-to-disk application unlike SQL. So it writes
to a fsync queue first which actually gets managed by the OS (this
is fundamentally NoSQL here to not write straight to disk,
“Eventually Consistent”), since MongoDB does no memory management of
The OS itself will then decide when paged in data should be removed
using the LRU algorithm:
Added ontop of this is that you must load a part of the _id btree
each time you insert as well which is ever growing due to
insertions. This means that actually if you do mass inserts in a
short period of time you could end up loading more of the btree than
you need to because the older section of the btree have not been
seen as stale yet.
How many “strange” explanations have you counted in the above answer?
Original title and link: A SO Answer About MongoDB Memory Usage ( ©myNoSQL)