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

Side by Side Diff: src/heap/heap.cc

Issue 1144223002: Avoid excessive GCs in small heaps. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 5280 matching lines...) Expand 10 before | Expand all | Expand 10 after
5291 return amount_of_external_allocated_memory_ - 5291 return amount_of_external_allocated_memory_ -
5292 amount_of_external_allocated_memory_at_last_global_gc_; 5292 amount_of_external_allocated_memory_at_last_global_gc_;
5293 } 5293 }
5294 5294
5295 5295
5296 intptr_t Heap::CalculateOldGenerationAllocationLimit(double factor, 5296 intptr_t Heap::CalculateOldGenerationAllocationLimit(double factor,
5297 intptr_t old_gen_size) { 5297 intptr_t old_gen_size) {
5298 CHECK(factor > 1.0); 5298 CHECK(factor > 1.0);
5299 CHECK(old_gen_size > 0); 5299 CHECK(old_gen_size > 0);
5300 intptr_t limit = static_cast<intptr_t>(old_gen_size * factor); 5300 intptr_t limit = static_cast<intptr_t>(old_gen_size * factor);
5301 limit = Max(limit, kMinimumOldGenerationAllocationLimit); 5301 limit = Max(limit, old_gen_size + kMinimumOldGenerationAllocationLimit);
5302 limit += new_space_.Capacity(); 5302 limit += new_space_.Capacity();
5303 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; 5303 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
5304 return Min(limit, halfway_to_the_max); 5304 return Min(limit, halfway_to_the_max);
5305 } 5305 }
5306 5306
5307 5307
5308 void Heap::SetOldGenerationAllocationLimit(intptr_t old_gen_size, 5308 void Heap::SetOldGenerationAllocationLimit(intptr_t old_gen_size,
5309 int freed_global_handles) { 5309 int freed_global_handles) {
5310 const int kMaxHandles = 1000; 5310 const int kMaxHandles = 1000;
5311 const int kMinHandles = 100; 5311 const int kMinHandles = 100;
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after
6573 *object_type = "CODE_TYPE"; \ 6573 *object_type = "CODE_TYPE"; \
6574 *object_sub_type = "CODE_AGE/" #name; \ 6574 *object_sub_type = "CODE_AGE/" #name; \
6575 return true; 6575 return true;
6576 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) 6576 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME)
6577 #undef COMPARE_AND_RETURN_NAME 6577 #undef COMPARE_AND_RETURN_NAME
6578 } 6578 }
6579 return false; 6579 return false;
6580 } 6580 }
6581 } 6581 }
6582 } // namespace v8::internal 6582 } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698