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

Unified Diff: test/cctest/heap/test-heap.cc

Issue 2057103002: Tune the memory pressure handler to perform a second GC immediately (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: x Created 4 years, 6 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 | « src/heap/heap.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/heap/test-heap.cc
diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc
index 32a4111e5bf1265b10758e5bbb7d5de7b0bfc1e9..f3782273598bf45ff00da41754f64bbf90096d94 100644
--- a/test/cctest/heap/test-heap.cc
+++ b/test/cctest/heap/test-heap.cc
@@ -6761,5 +6761,23 @@ TEST(Regress615489) {
CHECK_LE(size_after, size_before);
}
+TEST(Regress618958) {
+ CcTest::InitializeVM();
+ v8::HandleScope scope(CcTest::isolate());
+ Heap* heap = CcTest::heap();
+ bool isolate_is_locked = true;
+ heap->update_amount_of_external_allocated_memory(100 * MB);
+ int mark_sweep_count_before = heap->ms_count();
+ heap->MemoryPressureNotification(MemoryPressureLevel::kCritical,
+ isolate_is_locked);
+ int mark_sweep_count_after = heap->ms_count();
+ int mark_sweeps_performed = mark_sweep_count_after - mark_sweep_count_before;
+ // The memory pressuer handler either performed two GCs or performed one and
+ // started incremental marking.
+ CHECK(mark_sweeps_performed == 2 ||
+ (mark_sweeps_performed == 1 &&
+ !heap->incremental_marking()->IsStopped()));
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698