summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2012-02-06 00:52:20 -0500
committerEliot Horowitz <eliot@10gen.com>2012-02-06 00:52:20 -0500
commitd39bc96a0c15ee6714a53aee21e58f93a284c513 (patch)
tree1042c425b0dc30ff6e5a3e87387c40d29757bf3b
parent43fa534919634758b32353c77f18a4e608a39206 (diff)
downloadmongo-d39bc96a0c15ee6714a53aee21e58f93a284c513.tar.gz
don't print out leak message more than once per minutes SERVER-4780
-rw-r--r--db/dbcommands.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp
index b2e6218ff9f..fc6327cdfa4 100644
--- a/db/dbcommands.cpp
+++ b/db/dbcommands.cpp
@@ -514,7 +514,15 @@ namespace mongo {
if( overhead > 4000 ) {
t.append("note", "virtual minus mapped is large. could indicate a memory leak");
- log() << "warning: virtual size (" << v << "MB) - mapped size (" << m << "MB) is large (" << overhead << "MB). could indicate a memory leak" << endl;
+
+ static time_t last = 0;
+ time_t now = time(0);
+
+ if ( last + 60 < now ) {
+ last = now;
+ log() << "warning: virtual size (" << v << "MB) - mapped size (" << m << "MB) is large (" << overhead << "MB). could indicate a memory leak" << endl;
+ }
+
}
t.done();