Chromium Code Reviews| 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() |