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:
parent
5725f09db3
commit
9c8858d85a
@ -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
|
||||
|
@ -62,6 +62,7 @@ namespace mongo {
|
||||
void *view;
|
||||
long len;
|
||||
};
|
||||
|
||||
|
||||
void printMemInfo( const char * where );
|
||||
|
||||
} // namespace mongo
|
||||
|
@ -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(){
|
||||
|
Loading…
Reference in New Issue
Block a user