Index: src/heap/gc-idle-time-handler.h |
diff --git a/src/heap/gc-idle-time-handler.h b/src/heap/gc-idle-time-handler.h |
index b0bdce66143c818983b3849992a2efd01f2b9038..09050a279726563a0820c43da1984758990ae0cc 100644 |
--- a/src/heap/gc-idle-time-handler.h |
+++ b/src/heap/gc-idle-time-handler.h |
@@ -98,6 +98,14 @@ class GCIdleTimeHandler { |
// Number of scavenges that will trigger start of new idle round. |
static const int kIdleScavengeThreshold; |
+ // If less than that much memory is left in the new space, we consider it |
+ // as almost full and force a new space collection earlier in the idle time. |
+ static const size_t kNewSpaceAlmostFullTreshold = 100 * KB; |
+ |
+ // If we haven't recorded any scavenger events yet, we use a conservative |
+ // lower bound for the scavenger speed. |
+ static const size_t kInitialConservativeScavengeSpeed = 100 * KB; |
+ |
struct HeapState { |
int contexts_disposed; |
size_t size_of_objects; |
@@ -106,6 +114,9 @@ class GCIdleTimeHandler { |
bool sweeping_in_progress; |
size_t mark_compact_speed_in_bytes_per_ms; |
size_t incremental_marking_speed_in_bytes_per_ms; |
+ size_t scavenge_speed_in_bytes_per_ms; |
+ size_t available_new_space_memory; |
+ size_t new_space_capacity; |
}; |
GCIdleTimeHandler() |
@@ -132,9 +143,12 @@ class GCIdleTimeHandler { |
static size_t EstimateMarkCompactTime( |
size_t size_of_objects, size_t mark_compact_speed_in_bytes_per_ms); |
+ static size_t EstimateScavengeTime(size_t new_space_size, |
+ size_t scavenger_speed_in_bytes_per_ms); |
+ |
private: |
void StartIdleRound() { mark_compacts_since_idle_round_started_ = 0; } |
- bool IsIdleRoundFinished() { |
+ bool IsMarkCompactIdleRoundFinished() { |
return mark_compacts_since_idle_round_started_ == |
kMaxMarkCompactsInIdleRound; |
} |