Index: runtime/bin/process_win.cc |
diff --git a/runtime/bin/process_win.cc b/runtime/bin/process_win.cc |
index 56cd57d6b164b57539d914f76217e742a804f343..95f9cd34ad13f4c1bbc959568c9d9347ebed7d70 100644 |
--- a/runtime/bin/process_win.cc |
+++ b/runtime/bin/process_win.cc |
@@ -9,6 +9,7 @@ |
#include "bin/process.h" |
+#include <psapi.h> // NOLINT |
#include <process.h> // NOLINT |
#include "bin/builtin.h" |
@@ -941,6 +942,24 @@ intptr_t Process::CurrentProcessId() { |
} |
+int64_t Process::CurrentRSS() { |
+ PROCESS_MEMORY_COUNTERS pmc; |
+ if (!GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc))) { |
+ return -1; |
+ } |
+ return pmc.WorkingSetSize; |
+} |
+ |
+ |
+int64_t Process::MaxRSS() { |
+ PROCESS_MEMORY_COUNTERS pmc; |
+ if (!GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc))) { |
+ return -1; |
+ } |
+ return pmc.PeakWorkingSetSize; |
+} |
+ |
+ |
static SignalInfo* signal_handlers = NULL; |
static Mutex* signal_mutex = new Mutex(); |