diff options
Diffstat (limited to 'util/processinfo.cpp')
-rw-r--r-- | util/processinfo.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
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; + } + + } |