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

Unified Diff: runtime/vm/thread_registry.cc

Issue 2608463002: Added isolate + thread high watermark tracking to Observatory (Closed)
Patch Set: Added tracking of memory usage inside of threads. In addition, the max memory usage is kept track o… 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
« no previous file with comments | « runtime/vm/thread_registry.h ('k') | runtime/vm/thread_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread_registry.cc
diff --git a/runtime/vm/thread_registry.cc b/runtime/vm/thread_registry.cc
index eb39501bc0db930332b1975252287f3673306a72..2e914cac6575a588ec9ac31b75041b752b2d4787 100644
--- a/runtime/vm/thread_registry.cc
+++ b/runtime/vm/thread_registry.cc
@@ -146,6 +146,7 @@ Thread* ThreadRegistry::GetFromFreelistLocked(Isolate* isolate) {
return thread;
}
+
void ThreadRegistry::ReturnToFreelistLocked(Thread* thread) {
ASSERT(thread != NULL);
ASSERT(thread->os_thread_ == NULL);
@@ -157,4 +158,16 @@ void ThreadRegistry::ReturnToFreelistLocked(Thread* thread) {
free_list_ = thread;
}
+
+intptr_t ThreadRegistry::ThreadHighWatermarksTotalLocked() const {
+ ASSERT(threads_lock()->IsOwnedByCurrentThread());
+ intptr_t max_memory_usage_total = 0;
+ Thread* current = active_list_;
+ while (current != NULL) {
+ max_memory_usage_total += current->GetThreadHighWatermark();
+ current = current->next_;
+ }
+ return max_memory_usage_total;
+}
+
} // namespace dart
« no previous file with comments | « runtime/vm/thread_registry.h ('k') | runtime/vm/thread_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698