Index: runtime/bin/main.cc |
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc |
index 28d64117c9295c7ff2598bd977dada3777cdb1c1..ffbc2e738135cdef6550cf493f225e9792d5d9a9 100644 |
--- a/runtime/bin/main.cc |
+++ b/runtime/bin/main.cc |
@@ -1359,6 +1359,16 @@ static bool FileModifiedCallback(const char* url, int64_t since) { |
return modified; |
} |
+static void EmbedderInformationCallback(Dart_EmbedderInformation* info) { |
+ int64_t max_rss = Process::MaxRSS(); |
+ int64_t current_rss = Process::CurrentRSS(); |
+ |
+ info->version = DART_EMBEDDER_INFORMATION_CURRENT_VERSION; |
+ info->name = "Dart VM"; |
+ info->max_rss = max_rss >= 0 ? max_rss : 0; |
+ info->current_rss = current_rss >= 0 ? current_rss : 0; |
+} |
+ |
static void GenerateAppAOTSnapshot() { |
if (use_blobs) { |
Snapshot::GenerateAppAOTAsBlobs(snapshot_filename); |
@@ -1808,6 +1818,7 @@ void main(int argc, char** argv) { |
Dart_SetServiceStreamCallbacks(&ServiceStreamListenCallback, |
&ServiceStreamCancelCallback); |
Dart_SetFileModifiedCallback(&FileModifiedCallback); |
+ Dart_SetEmbedderInformationCallback(&EmbedderInformationCallback); |
// Run the main isolate until we aren't told to restart. |
while (RunMainIsolate(script_name, &dart_options)) { |