Index: runtime/bin/process_fuchsia.cc |
diff --git a/runtime/bin/process_fuchsia.cc b/runtime/bin/process_fuchsia.cc |
index 26ca132afe6f114a3f1663492827644b6c4fd530..11e21acc98f15ed6a5e2b175fb6c7969ed4afa95 100644 |
--- a/runtime/bin/process_fuchsia.cc |
+++ b/runtime/bin/process_fuchsia.cc |
@@ -431,6 +431,25 @@ intptr_t Process::CurrentProcessId() { |
} |
+intptr_t Process::CurrentRSS() { |
+ mx_info_task_stats_t task_stats; |
+ mx_handle_t process = mx_process_self(); |
+ mx_status_t status = mx_object_get_info( |
+ process, MX_INFO_TASK_STATS, &task_stats, sizeof(task_stats), NULL, NULL); |
+ if (status != NO_ERROR) { |
+ return ERRNO(status); |
+ } |
+ return task_stats.mem_committed_bytes; |
+} |
+ |
+ |
+intptr_t Process::MaxRSS() { |
+ // There is currently no way to get the high watermark value on Fuchsia, so |
+ // just return the current RSS value. |
+ return CurrentRSS(); |
+} |
+ |
+ |
static bool ProcessWaitCleanup(intptr_t out, |
intptr_t err, |
intptr_t exit_event, |