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

Unified Diff: runtime/vm/zone.cc

Issue 2608463002: Added isolate + thread high watermark tracking to Observatory (Closed)
Patch Set: Created 4 years 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
« runtime/vm/isolate.cc ('K') | « runtime/vm/thread_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/zone.cc
diff --git a/runtime/vm/zone.cc b/runtime/vm/zone.cc
index 36e962260dd30ed433c67ff89812392ece46ec04..8dafe15f92211f040ad9706523b9bab7b968b687 100644
--- a/runtime/vm/zone.cc
+++ b/runtime/vm/zone.cc
@@ -44,6 +44,9 @@ class Zone::Segment {
void Zone::Segment::DeleteSegmentList(Segment* head) {
Segment* current = head;
while (current != NULL) {
+ if (Thread::Current() != NULL) {
+ Thread::Current()->DecrementThreadMemoryUsage(current->size());
+ }
siva 2016/12/27 22:09:26 Please hoist Thread:Current() outside the loop int
bkonyi 2016/12/28 00:09:58 Done. There's a case when running the unit tests
siva 2016/12/28 17:52:35 It can be Null when the native IO isolate is alloc
bkonyi 2016/12/28 19:00:49 I've added a TODO to handle the special case when
Segment* next = current->next();
#ifdef DEBUG
// Zap the entire current segment (including the header).
@@ -68,6 +71,9 @@ Zone::Segment* Zone::Segment::New(intptr_t size, Zone::Segment* next) {
#endif
result->next_ = next;
result->size_ = size;
+ if (Thread::Current() != NULL) {
+ Thread::Current()->IncrementThreadMemoryUsage(size);
+ }
return result;
}
« runtime/vm/isolate.cc ('K') | « runtime/vm/thread_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698