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

Unified Diff: src/heap.cc

Issue 8657: Check the growth of the old generation before expanding the paged... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years, 2 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.h ('k') | src/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 631)
+++ src/heap.cc (working copy)
@@ -64,7 +64,12 @@
MapSpace* Heap::map_space_ = NULL;
LargeObjectSpace* Heap::lo_space_ = NULL;
-int Heap::promoted_space_limit_ = 0;
+static const int kMinimumPromotionLimit = 2*MB;
+static const int kMinimumAllocationLimit = 8*MB;
+
+int Heap::old_gen_promotion_limit_ = kMinimumPromotionLimit;
+int Heap::old_gen_allocation_limit_ = kMinimumAllocationLimit;
+
int Heap::old_gen_exhausted_ = false;
int Heap::amount_of_external_allocated_memory_ = 0;
@@ -138,8 +143,7 @@
}
// Is enough data promoted to justify a global GC?
- if (PromotedSpaceSize() + PromotedExternalMemorySize()
- > promoted_space_limit_) {
+ if (OldGenerationPromotionLimitReached()) {
Counters::gc_compactor_caused_by_promoted_data.Increment();
return MARK_COMPACTOR;
}
@@ -360,9 +364,11 @@
if (collector == MARK_COMPACTOR) {
MarkCompact(tracer);
- int promoted_space_size = PromotedSpaceSize();
- promoted_space_limit_ =
- promoted_space_size + Max(2 * MB, (promoted_space_size/100) * 35);
+ int old_gen_size = PromotedSpaceSize();
+ old_gen_promotion_limit_ =
+ old_gen_size + Max(kMinimumPromotionLimit, old_gen_size / 3);
+ old_gen_allocation_limit_ =
+ old_gen_size + Max(kMinimumAllocationLimit, old_gen_size / 3);
old_gen_exhausted_ = false;
// If we have used the mark-compact collector to collect the new
@@ -2291,7 +2297,8 @@
PrintF(">>>>>> =============== %s (%d) =============== >>>>>>\n",
title, gc_count_);
PrintF("mark-compact GC : %d\n", mc_count_);
- PrintF("promoted_space_limit_ %d\n", promoted_space_limit_);
+ PrintF("old_gen_promotion_limit_ %d\n", old_gen_promotion_limit_);
+ PrintF("old_gen_allocation_limit_ %d\n", old_gen_allocation_limit_);
PrintF("\n");
PrintF("Number of handles : %d\n", HandleScope::NumberOfHandles());
« no previous file with comments | « src/heap.h ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698