Chromium Code Reviews| Index: runtime/vm/isolate.cc |
| diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc |
| index 8304532470999c81ea515843ad6496c8348db0f3..24007c514abc34dd98ed11a5b03df36b9ccf7f0b 100644 |
| --- a/runtime/vm/isolate.cc |
| +++ b/runtime/vm/isolate.cc |
| @@ -2103,6 +2103,8 @@ void Isolate::PrintJSON(JSONStream* stream, bool ref) { |
| } |
| } |
| + jsobj.AddProperty("isolateMemoryHighWatermark", |
| + isolate_memory_high_watermark_); |
|
siva
2016/12/27 22:09:26
Do we have a comment section somewhere were we doc
bkonyi
2016/12/28 00:09:58
There is the Dart VM service protocol document und
siva
2016/12/28 17:52:35
Please check with John/Todd on the protocol for up
bkonyi
2016/12/28 19:00:49
Done.
|
| jsobj.AddProperty("threads", thread_registry_); |
| } |
| #endif |
| @@ -2699,6 +2701,7 @@ void Isolate::UnscheduleThread(Thread* thread, |
| // Ensure that the thread reports itself as being at a safepoint. |
| thread->EnterSafepoint(); |
| } |
| + UpdateIsolateHighWatermark(); |
| OSThread* os_thread = thread->os_thread(); |
| ASSERT(os_thread != NULL); |
| os_thread->DisableThreadInterrupts(); |
| @@ -2713,12 +2716,22 @@ void Isolate::UnscheduleThread(Thread* thread, |
| thread->set_execution_state(Thread::kThreadInNative); |
| thread->set_safepoint_state(Thread::SetAtSafepoint(true, 0)); |
| thread->clear_pending_functions(); |
| + thread->ClearThreadMemoryUsageStats(); |
| ASSERT(thread->no_safepoint_scope_depth() == 0); |
| // Return thread structure. |
| thread_registry()->ReturnThreadLocked(is_mutator, thread); |
| } |
| +void Isolate::UpdateIsolateHighWatermark() { |
| + intptr_t thread_watermarks_total = |
| + thread_registry()->ThreadHighWatermarksTotalLocked(); |
| + if (thread_watermarks_total > isolate_memory_high_watermark_) { |
| + isolate_memory_high_watermark_ = thread_watermarks_total; |
| + } |
| +} |
| + |
| + |
| static RawInstance* DeserializeObject(Thread* thread, |
| uint8_t* obj_data, |
| intptr_t obj_len) { |