It would be useful to have a built-in facility for debugging memory consumption issues in mongod, as this has become an increasingly frequent problem, both in the field and in development.
- built in to mongod - no additional software dependencies need to be installed. This is important pariculary for diagnosing memory problems in the field, but also will make in-house diagnosis simpler.
- enabled in one of the following ways (in decreasing order of preference)
- dynamically by a runtime command
- at startup time by a mongod startup option
- by compiling a special version of mongod (using flags to scons defined for the purpose)
- performance impact should be the best achievable of the following (rough guesses at required performance impact in parens):
- small enough that the facility could be left on indefinitely in production (<1% impact)
- small enough that the facility could be turned on for a limited time in production (<10% impact)
- small enough that we could ask a customer to use it while reproducing a memory issue in a test environment (<50% impact)
- the facility should be able to diagnose, identifying by source code call-site the source of the memory consumption, the following classes of issues:
- memory leaks - memory not deallocated at exit
- excess or unexpected memory consumption that is not a leak as such, that is, the memory is still tracked and would be freed on exit