diff options
author | Mathias Stearn <mathias@10gen.com> | 2010-01-15 16:59:39 -0500 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2010-01-15 16:59:39 -0500 |
commit | 42ec730af272cacbf312c69baddf97a3d9991d5b (patch) | |
tree | c080438f44c66f6ddcc5932b08ccf6094a598856 | |
parent | efbf3382cd76ef742e31a75e699c17864929723b (diff) | |
download | mongo-42ec730af272cacbf312c69baddf97a3d9991d5b.tar.gz |
Better VirtualMemorySize on windows
-rw-r--r-- | util/processinfo_win32.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/util/processinfo_win32.cpp b/util/processinfo_win32.cpp index 978c52d2d58..7148cf3fba1 100644 --- a/util/processinfo_win32.cpp +++ b/util/processinfo_win32.cpp @@ -46,9 +46,10 @@ namespace mongo { } int ProcessInfo::getVirtualMemorySize(){ - PROCESS_MEMORY_COUNTERS pmc; - assert( GetProcessMemoryInfo( GetCurrentProcess() , &pmc, sizeof(pmc) ) ); - return _wconvertmtos( pmc.PagefileUsage ); + MEMORYSTATUSEX mse; + mse.dwLength = sizeof(mse); + assert( GlobalMemoryStatusEx( &mse ) ); + return (mse.ullTotalVirtual - mse.ullAvailVirtual) / (1024 * 1024) ; } int ProcessInfo::getResidentSize(){ |