Chromium Code Reviews

Unified Diff: Source/platform/heap/ThreadState.h

Issue 1174123002: Oilpan: adjust GC policy under memory pressure. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: shift more GC responsibilities into didV8MajorGC() Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: Source/platform/heap/ThreadState.h
diff --git a/Source/platform/heap/ThreadState.h b/Source/platform/heap/ThreadState.h
index 213170db701f44d52e20cb88735a751a38d74add..c2365ff5b28580b1e1724cf5d715ebcefdb77f13 100644
--- a/Source/platform/heap/ThreadState.h
+++ b/Source/platform/heap/ThreadState.h
@@ -316,7 +316,7 @@ public:
return true;
}
- void didV8GC();
+ void didV8MajorGC(bool forceGC);
void performIdleGC(double deadlineSeconds);
void performIdleLazySweep(double deadlineSeconds);
@@ -649,13 +649,19 @@ private:
// shouldSchedule{Precise,Idle}GC and shouldForceConservativeGC
// implement the heuristics that are used to determine when to collect garbage.
// If shouldForceConservativeGC returns true, we force the garbage
- // collection immediately. Otherwise, if shouldGC returns true, we
+ // collection immediately. Otherwise, if should*GC() returns true, we
// record that we should garbage collect the next time we return
// to the event loop. If both return false, we don't need to
// collect garbage at this point.
bool shouldScheduleIdleGC();
bool shouldSchedulePreciseGC();
bool shouldForceConservativeGC();
+
+ // Internal helper for shouldForceConservativeGC() and didV8MajorGC();
+ // returns true iff an urgent conservative GC is needed to try to
+ // relieve memory pressure.
+ bool shouldForceMemoryPressureGC();
+
void runScheduledGC(StackState);
void eagerSweep();

Powered by Google App Engine