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

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

Issue 934803002: Start with a more conservative initial old generation size. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 | « src/heap/heap.h ('k') | 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 amount_of_external_allocated_memory_at_last_global_gc_(0), 60 amount_of_external_allocated_memory_at_last_global_gc_(0),
61 isolate_(NULL), 61 isolate_(NULL),
62 code_range_size_(0), 62 code_range_size_(0),
63 // semispace_size_ should be a power of 2 and old_generation_size_ should 63 // semispace_size_ should be a power of 2 and old_generation_size_ should
64 // be a multiple of Page::kPageSize. 64 // be a multiple of Page::kPageSize.
65 reserved_semispace_size_(8 * (kPointerSize / 4) * MB), 65 reserved_semispace_size_(8 * (kPointerSize / 4) * MB),
66 max_semi_space_size_(8 * (kPointerSize / 4) * MB), 66 max_semi_space_size_(8 * (kPointerSize / 4) * MB),
67 initial_semispace_size_(Page::kPageSize), 67 initial_semispace_size_(Page::kPageSize),
68 target_semispace_size_(Page::kPageSize), 68 target_semispace_size_(Page::kPageSize),
69 max_old_generation_size_(700ul * (kPointerSize / 4) * MB), 69 max_old_generation_size_(700ul * (kPointerSize / 4) * MB),
70 initial_old_generation_size_(max_old_generation_size_), 70 initial_old_generation_size_(max_old_generation_size_ /
71 kInitalOldGenerationLimitFactor),
71 old_generation_size_configured_(false), 72 old_generation_size_configured_(false),
72 max_executable_size_(256ul * (kPointerSize / 4) * MB), 73 max_executable_size_(256ul * (kPointerSize / 4) * MB),
73 // Variables set based on semispace_size_ and old_generation_size_ in 74 // Variables set based on semispace_size_ and old_generation_size_ in
74 // ConfigureHeap. 75 // ConfigureHeap.
75 // Will be 4 * reserved_semispace_size_ to ensure that young 76 // Will be 4 * reserved_semispace_size_ to ensure that young
76 // generation can be aligned to its size. 77 // generation can be aligned to its size.
77 maximum_committed_(0), 78 maximum_committed_(0),
78 survived_since_last_expansion_(0), 79 survived_since_last_expansion_(0),
79 survived_last_scavenge_(0), 80 survived_last_scavenge_(0),
80 sweep_generation_(0), 81 sweep_generation_(0),
(...skipping 5193 matching lines...) Expand 10 before | Expand all | Expand 10 after
5274 5275
5275 // The old generation is paged and needs at least one page for each space. 5276 // The old generation is paged and needs at least one page for each space.
5276 int paged_space_count = LAST_PAGED_SPACE - FIRST_PAGED_SPACE + 1; 5277 int paged_space_count = LAST_PAGED_SPACE - FIRST_PAGED_SPACE + 1;
5277 max_old_generation_size_ = 5278 max_old_generation_size_ =
5278 Max(static_cast<intptr_t>(paged_space_count * Page::kPageSize), 5279 Max(static_cast<intptr_t>(paged_space_count * Page::kPageSize),
5279 max_old_generation_size_); 5280 max_old_generation_size_);
5280 5281
5281 if (FLAG_initial_old_space_size > 0) { 5282 if (FLAG_initial_old_space_size > 0) {
5282 initial_old_generation_size_ = FLAG_initial_old_space_size * MB; 5283 initial_old_generation_size_ = FLAG_initial_old_space_size * MB;
5283 } else { 5284 } else {
5284 initial_old_generation_size_ = max_old_generation_size_ / 2; 5285 initial_old_generation_size_ =
5286 max_old_generation_size_ / kInitalOldGenerationLimitFactor;
5285 } 5287 }
5286 old_generation_allocation_limit_ = initial_old_generation_size_; 5288 old_generation_allocation_limit_ = initial_old_generation_size_;
5287 5289
5288 // We rely on being able to allocate new arrays in paged spaces. 5290 // We rely on being able to allocate new arrays in paged spaces.
5289 DCHECK(Page::kMaxRegularHeapObjectSize >= 5291 DCHECK(Page::kMaxRegularHeapObjectSize >=
5290 (JSArray::kSize + 5292 (JSArray::kSize +
5291 FixedArray::SizeFor(JSObject::kInitialMaxFastElementArray) + 5293 FixedArray::SizeFor(JSObject::kInitialMaxFastElementArray) +
5292 AllocationMemento::kSize)); 5294 AllocationMemento::kSize));
5293 5295
5294 code_range_size_ = code_range_size * MB; 5296 code_range_size_ = code_range_size * MB;
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after
6520 static_cast<int>(object_sizes_last_time_[index])); 6522 static_cast<int>(object_sizes_last_time_[index]));
6521 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6523 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6522 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6524 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6523 6525
6524 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6526 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6525 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6527 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6526 ClearObjectStats(); 6528 ClearObjectStats();
6527 } 6529 }
6528 } 6530 }
6529 } // namespace v8::internal 6531 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698