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

Unified Diff: third_party/WebKit/Source/platform/heap/ThreadState.cpp

Issue 2178393002: Fix BlinkGC triggering so it is more sensitive to PartitionAlloc only allocations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/ThreadState.cpp
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.cpp b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
index c7a798884f0095e4f71af5433040b9c8a543db31..41719826fe9e1e0af04d4de3b654229bfe343da8 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
@@ -503,15 +503,19 @@ double ThreadState::partitionAllocGrowingRate()
// performance significantly.
bool ThreadState::judgeGCThreshold(size_t totalMemorySizeThreshold, double heapGrowingRateThreshold)
{
- // If the allocated object size or the total memory size is small, don't trigger a GC.
- if (m_heap->heapStats().allocatedObjectSize() < 100 * 1024 || totalMemorySize() < totalMemorySizeThreshold)
+ // If the total memory size is small, don't trigger a GC.
+ if (totalMemorySize() < totalMemorySizeThreshold)
return false;
- // If the growing rate of Oilpan's heap or PartitionAlloc is high enough,
- // trigger a GC.
-#if PRINT_HEAP_STATS
haraken 2016/07/26 14:40:51 Shall we keep this line?
- dataLogF("heapGrowingRate=%.1lf, partitionAllocGrowingRate=%.1lf\n", heapGrowingRate(), partitionAllocGrowingRate());
-#endif
- return heapGrowingRate() >= heapGrowingRateThreshold || partitionAllocGrowingRate() >= heapGrowingRateThreshold;
+
+ // If the growing rate of PartitionAlloc is high enough, trigger a GC.
+ if (partitionAllocGrowingRate() >= heapGrowingRateThreshold)
haraken 2016/07/26 14:40:51 I'm a bit afraid of this change. After this change
keishi 2016/07/26 15:46:13 Yeah. I'm running the perf tests right now but it
+ return true;
+
+ // If the allocated object size is small, don't trigger a GC.
+ if (m_heap->heapStats().allocatedObjectSize() < 100 * 1024)
+ return false;
+ // If the growing rate of Oilpan's heap is high enough, trigger a GC.
+ return heapGrowingRate() >= heapGrowingRateThreshold;
}
bool ThreadState::shouldScheduleIdleGC()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698