In SERVER-35666 we saw that keeping a query open for a long time can lead to memory buildup due to ChunkManager objects not being cleaned up. This is because here, when we go to expire old ChunkManager objects, we iterate through the queue of metadata objects from oldest to newest, and if we find an object with a usageCounter > 0, we stop, so that we don't delete an object used by an ongoing query.
However, this is overly conservative. It's possible that the oldest object in the queue could have one query attached to it (usageCounter = 1), while many newer metadata objects have usageCounter = 0 and thus could be deleted. I believe we could also delete even metadata objects that have orphans on them, if the metadata object is never used by the range deleter.
- is duplicated by
-
SERVER-35666 mongod process consumes all memory and then exits or is being killed by oom-killer
- Closed
-
SERVER-38929 Refresh of RoutingTableHistory causes large rise in memory usage
- Closed
- is related to
-
SERVER-42138 Memory used by ChunkManager objects can grow without bound
- Closed