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

Unified Diff: src/inspector/v8-debugger.cc

Issue 2824293002: [inspector] cleanup all task related data when limit reached (Closed)
Patch Set: tuned const based on measurements Created 3 years, 8 months 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
Index: src/inspector/v8-debugger.cc
diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc
index 1e9ee03b16adca1109bab4f0a0b2c650f1faeda0..4a9ca5a55a5054c22ba8d61fce511266a81033c2 100644
--- a/src/inspector/v8-debugger.cc
+++ b/src/inspector/v8-debugger.cc
@@ -21,7 +21,7 @@ namespace v8_inspector {
namespace {
-static const int kMaxAsyncTaskStacks = 1024 * 1024;
+static const int kMaxAsyncTaskStacks = 128 * 1024;
inline v8::Local<v8::Boolean> v8Boolean(bool value, v8::Isolate* isolate) {
return value ? v8::True(isolate) : v8::False(isolate);
@@ -1023,6 +1023,18 @@ void V8Debugger::collectOldAsyncStacksIfNeeded() {
}
removeOldAsyncTasks(m_asyncTaskStacks);
removeOldAsyncTasks(m_asyncTaskCreationStacks);
+ protocol::HashSet<void*> recurringLeft;
+ for (auto task : m_recurringTasks) {
+ if (m_asyncTaskStacks.find(task) == m_asyncTaskStacks.end()) continue;
+ recurringLeft.insert(task);
+ }
+ m_recurringTasks.swap(recurringLeft);
+ protocol::HashMap<void*, void*> parentLeft;
+ for (auto it : m_parentTask) {
+ if (m_asyncTaskStacks.find(it.first) == m_asyncTaskStacks.end()) continue;
+ parentLeft.insert(it);
+ }
+ m_parentTask.swap(parentLeft);
}
void V8Debugger::removeOldAsyncTasks(AsyncTaskToStackTrace& map) {

Powered by Google App Engine
This is Rietveld 408576698