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

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

Issue 961303002: Adjust OldGenerationAllocationLimit to grow the limit slower. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 5344 matching lines...) Expand 10 before | Expand all | Expand 10 after
5355 if (amount_of_external_allocated_memory_ <= 5355 if (amount_of_external_allocated_memory_ <=
5356 amount_of_external_allocated_memory_at_last_global_gc_) 5356 amount_of_external_allocated_memory_at_last_global_gc_)
5357 return 0; 5357 return 0;
5358 return amount_of_external_allocated_memory_ - 5358 return amount_of_external_allocated_memory_ -
5359 amount_of_external_allocated_memory_at_last_global_gc_; 5359 amount_of_external_allocated_memory_at_last_global_gc_;
5360 } 5360 }
5361 5361
5362 5362
5363 intptr_t Heap::OldGenerationAllocationLimit(intptr_t old_gen_size, 5363 intptr_t Heap::OldGenerationAllocationLimit(intptr_t old_gen_size,
5364 int freed_global_handles) { 5364 int freed_global_handles) {
5365 const int kMaxHandles = 1000; 5365 const int kMaxHandles = 50;
5366 const int kMinHandles = 100; 5366 const int kMinHandles = 10;
5367 double min_factor = 1.1; 5367 double min_factor = 1.1;
5368 double max_factor = 4; 5368 double max_factor = 4;
5369 // We set the old generation growing factor to 2 to grow the heap slower on 5369 // We set the old generation growing factor to 2 to grow the heap slower on
5370 // memory-constrained devices. 5370 // memory-constrained devices.
5371 if (max_old_generation_size_ <= kMaxOldSpaceSizeMediumMemoryDevice) { 5371 if (max_old_generation_size_ <= kMaxOldSpaceSizeMediumMemoryDevice) {
5372 max_factor = 2; 5372 max_factor = 2;
5373 } 5373 }
5374 // If there are many freed global handles, then the next full GC will 5374 // If there are many freed global handles, then the next full GC will
5375 // likely collect a lot of garbage. Choose the heap growing factor 5375 // likely collect a lot of garbage. Choose the heap growing factor
5376 // depending on freed global handles. 5376 // depending on freed global handles.
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after
6524 static_cast<int>(object_sizes_last_time_[index])); 6524 static_cast<int>(object_sizes_last_time_[index]));
6525 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6525 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6526 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6526 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6527 6527
6528 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6528 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6529 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6529 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6530 ClearObjectStats(); 6530 ClearObjectStats();
6531 } 6531 }
6532 } 6532 }
6533 } // namespace v8::internal 6533 } // 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