Use an upper bound for marking time estimation in idle notification.
BUG= R=ulan@chromium.org Review URL: https://codereview.chromium.org/571913003 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@23954 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
de71f7bd16
commit
89db44a94e
@ -32,8 +32,8 @@ class GCIdleTimeHandlerTest : public ::testing::Test {
|
||||
}
|
||||
|
||||
static const size_t kSizeOfObjects = 100 * MB;
|
||||
static const size_t kMarkCompactSpeed = 100 * KB;
|
||||
static const size_t kMarkingSpeed = 100 * KB;
|
||||
static const size_t kMarkCompactSpeed = 200 * KB;
|
||||
static const size_t kMarkingSpeed = 200 * KB;
|
||||
|
||||
private:
|
||||
GCIdleTimeHandler handler_;
|
||||
@ -87,7 +87,7 @@ TEST(GCIdleTimeHandler, EstimateMarkCompactTimeInitial) {
|
||||
|
||||
TEST(GCIdleTimeHandler, EstimateMarkCompactTimeNonZero) {
|
||||
size_t size = 100 * MB;
|
||||
size_t speed = 10 * KB;
|
||||
size_t speed = 1 * MB;
|
||||
size_t time = GCIdleTimeHandler::EstimateMarkCompactTime(size, speed);
|
||||
EXPECT_EQ(size / speed, time);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
const double GCIdleTimeHandler::kConservativeTimeRatio = 0.9;
|
||||
const size_t GCIdleTimeHandler::kMaxMarkCompactTimeInMs = 1000000;
|
||||
const size_t GCIdleTimeHandler::kMaxMarkCompactTimeInMs = 1000;
|
||||
const size_t GCIdleTimeHandler::kMinTimeForFinalizeSweeping = 100;
|
||||
const int GCIdleTimeHandler::kMaxMarkCompactsInIdleRound = 7;
|
||||
const int GCIdleTimeHandler::kIdleScavengeThreshold = 5;
|
||||
@ -78,9 +78,10 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms,
|
||||
}
|
||||
}
|
||||
if (heap_state.incremental_marking_stopped) {
|
||||
if (idle_time_in_ms >= EstimateMarkCompactTime(
|
||||
heap_state.size_of_objects,
|
||||
heap_state.mark_compact_speed_in_bytes_per_ms) ||
|
||||
size_t estimated_time_in_ms =
|
||||
EstimateMarkCompactTime(heap_state.size_of_objects,
|
||||
heap_state.mark_compact_speed_in_bytes_per_ms);
|
||||
if (idle_time_in_ms >= estimated_time_in_ms ||
|
||||
(heap_state.size_of_objects < kSmallHeapSize &&
|
||||
heap_state.contexts_disposed > 0)) {
|
||||
// If there are no more than two GCs left in this idle round and we are
|
||||
|
Loading…
Reference in New Issue
Block a user