summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-01-26 11:21:16 -0500
committerEliot Horowitz <eliot@10gen.com>2011-01-26 11:21:16 -0500
commit6001665cee7d1dfd04d97058691c9d72ac190150 (patch)
tree6588fae2d089c2d2c30e6214ed8e99b8f0092c52 /util
parent60034218a71b89069750e693d53fe35676f3c775 (diff)
downloadmongo-6001665cee7d1dfd04d97058691c9d72ac190150.tar.gz
cleaning ProcessInfo usage so don't need in client
Diffstat (limited to 'util')
-rw-r--r--util/mmap.cpp13
-rw-r--r--util/mmap.h2
-rw-r--r--util/processinfo.cpp15
-rw-r--r--util/processinfo.h2
4 files changed, 17 insertions, 15 deletions
diff --git a/util/mmap.cpp b/util/mmap.cpp
index 4e60b4e6306..03b31975995 100644
--- a/util/mmap.cpp
+++ b/util/mmap.cpp
@@ -57,19 +57,6 @@ namespace mongo {
return map( filename , l, options );
}
- void printMemInfo( const char * where ) {
- cout << "mem info: ";
- if ( where )
- cout << where << " ";
- ProcessInfo pi;
- if ( ! pi.supported() ) {
- cout << " not supported" << endl;
- return;
- }
-
- cout << "vsize: " << pi.getVirtualMemorySize() << " resident: " << pi.getResidentSize() << " mapped: " << ( MemoryMappedFile::totalMappedLength() / ( 1024 * 1024 ) ) << endl;
- }
-
/* --- MongoFile -------------------------------------------------
this is the administrative stuff
*/
diff --git a/util/mmap.h b/util/mmap.h
index beefa0fed80..8884a110ef4 100644
--- a/util/mmap.h
+++ b/util/mmap.h
@@ -187,8 +187,6 @@ namespace mongo {
void* remapPrivateView(void *oldPrivateAddr);
};
- void printMemInfo( const char * where );
-
typedef MemoryMappedFile MMF;
/** p is called from within a mutex that MongoFile uses. so be careful not to deadlock. */
diff --git a/util/processinfo.cpp b/util/processinfo.cpp
index d6ba6baf1f7..2d5b6e3c3ad 100644
--- a/util/processinfo.cpp
+++ b/util/processinfo.cpp
@@ -17,6 +17,7 @@
#include "pch.h"
#include "processinfo.h"
+#include "mmap.h"
#include <iostream>
using namespace std;
@@ -44,4 +45,18 @@ namespace mongo {
pidFileWiper.write( path );
}
+ void printMemInfo( const char * where ) {
+ cout << "mem info: ";
+ if ( where )
+ cout << where << " ";
+ ProcessInfo pi;
+ if ( ! pi.supported() ) {
+ cout << " not supported" << endl;
+ return;
+ }
+
+ cout << "vsize: " << pi.getVirtualMemorySize() << " resident: " << pi.getResidentSize() << " mapped: " << ( MemoryMappedFile::totalMappedLength() / ( 1024 * 1024 ) ) << endl;
+ }
+
+
}
diff --git a/util/processinfo.h b/util/processinfo.h
index 52b7fa3a8e6..b10e6fe9a38 100644
--- a/util/processinfo.h
+++ b/util/processinfo.h
@@ -62,4 +62,6 @@ namespace mongo {
void writePidFile( const std::string& path );
+ void printMemInfo( const char * where );
+
}