0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

printMemInfo helper, fix darwin virtual size reporting

This commit is contained in:
Eliot Horowitz 2010-02-20 16:16:17 -05:00
parent 5725f09db3
commit 9c8858d85a
3 changed files with 18 additions and 2 deletions

View File

@ -17,6 +17,7 @@
#include "stdafx.h"
#include "mmap.h"
#include "processinfo.h"
namespace mongo {
@ -92,4 +93,18 @@ namespace mongo {
return map( filename , i );
}
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;
}
} // namespace mongo

View File

@ -62,6 +62,7 @@ namespace mongo {
void *view;
long len;
};
void printMemInfo( const char * where );
} // namespace mongo

View File

@ -67,7 +67,7 @@ namespace mongo {
cout << "error getting task_info: " << result << endl;
return 0;
}
return (int)((double)ti.virtual_size / (1024.0 * 1024 * 2 ) );
return (int)((double)ti.virtual_size / (1024.0 * 1024 ) );
}
int ProcessInfo::getResidentSize(){