|
The Top singleton object keeps state about find/update/remove operations against non-existent collections. This is unexpected.
If a malfunctioning or malicious client repeatedly issues queries against unique non-existent collections, the "top" command will start to return an error after the size of the response object exceeds the maximum size of a BSON object, and the Top usage map will grow to an arbitrary size in memory. This memory can be reclaimed with a restart of the mongod process.
Reproduce with the following script:
db.dropDatabase();
|
db.foo.find().itcount();
|
db.baz.update({}, {$set: {a: 1}});
|
db.bar.remove({});
|
var res = db.adminCommand("top");
|
assert.isnull(res.totals["test.foo"]); // Trips: unexpected.
|
assert.isnull(res.totals["test.bar"]); // Trips: unexpected.
|
assert.isnull(res.totals["test.baz"]); // Trips: unexpected.
|
|