Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(737)

Unified Diff: tools/ProcStats.cpp

Issue 661413004: Implement maxrss for Windows (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: speeeeeeelling Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ProcStats.cpp
diff --git a/tools/ProcStats.cpp b/tools/ProcStats.cpp
index eaa1379301833cb28e218345e7d6d31c95863bb8..c9f9f3f6c55d3da680faad2b659e2622a9b757f3 100644
--- a/tools/ProcStats.cpp
+++ b/tools/ProcStats.cpp
@@ -22,8 +22,16 @@
#endif
}
-#else
+#elif defined(SK_BUILD_FOR_WIN32)
+ #include <windows.h>
+ #include <psapi.h>
+ int sk_tools::getMaxResidentSetSizeMB() {
+ PROCESS_MEMORY_COUNTERS info;
+ GetProcessMemoryInfo(GetCurrentProcess(), &info, sizeof(info));
+ return static_cast<int>(info.PeakWorkingSetSize / 1024 / 1024); // Windows reports bytes.
+ }
+#else
int sk_tools::getMaxResidentSetSizeMB() {
return -1;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698