Commit 89db44a9 authored by hpayer@chromium.org's avatar hpayer@chromium.org

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
parent de71f7bd
...@@ -32,8 +32,8 @@ class GCIdleTimeHandlerTest : public ::testing::Test { ...@@ -32,8 +32,8 @@ class GCIdleTimeHandlerTest : public ::testing::Test {
} }
static const size_t kSizeOfObjects = 100 * MB; static const size_t kSizeOfObjects = 100 * MB;
static const size_t kMarkCompactSpeed = 100 * KB; static const size_t kMarkCompactSpeed = 200 * KB;
static const size_t kMarkingSpeed = 100 * KB; static const size_t kMarkingSpeed = 200 * KB;
private: private:
GCIdleTimeHandler handler_; GCIdleTimeHandler handler_;
...@@ -87,7 +87,7 @@ TEST(GCIdleTimeHandler, EstimateMarkCompactTimeInitial) { ...@@ -87,7 +87,7 @@ TEST(GCIdleTimeHandler, EstimateMarkCompactTimeInitial) {
TEST(GCIdleTimeHandler, EstimateMarkCompactTimeNonZero) { TEST(GCIdleTimeHandler, EstimateMarkCompactTimeNonZero) {
size_t size = 100 * MB; size_t size = 100 * MB;
size_t speed = 10 * KB; size_t speed = 1 * MB;
size_t time = GCIdleTimeHandler::EstimateMarkCompactTime(size, speed); size_t time = GCIdleTimeHandler::EstimateMarkCompactTime(size, speed);
EXPECT_EQ(size / speed, time); EXPECT_EQ(size / speed, time);
} }
......
...@@ -10,7 +10,7 @@ namespace v8 { ...@@ -10,7 +10,7 @@ namespace v8 {
namespace internal { namespace internal {
const double GCIdleTimeHandler::kConservativeTimeRatio = 0.9; 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 size_t GCIdleTimeHandler::kMinTimeForFinalizeSweeping = 100;
const int GCIdleTimeHandler::kMaxMarkCompactsInIdleRound = 7; const int GCIdleTimeHandler::kMaxMarkCompactsInIdleRound = 7;
const int GCIdleTimeHandler::kIdleScavengeThreshold = 5; const int GCIdleTimeHandler::kIdleScavengeThreshold = 5;
...@@ -78,9 +78,10 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms, ...@@ -78,9 +78,10 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms,
} }
} }
if (heap_state.incremental_marking_stopped) { if (heap_state.incremental_marking_stopped) {
if (idle_time_in_ms >= EstimateMarkCompactTime( size_t estimated_time_in_ms =
heap_state.size_of_objects, EstimateMarkCompactTime(heap_state.size_of_objects,
heap_state.mark_compact_speed_in_bytes_per_ms) || 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.size_of_objects < kSmallHeapSize &&
heap_state.contexts_disposed > 0)) { heap_state.contexts_disposed > 0)) {
// If there are no more than two GCs left in this idle round and we are // If there are no more than two GCs left in this idle round and we are
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment