Chromium Code Reviews| Index: src/heap.h |
| =================================================================== |
| --- src/heap.h (revision 8902) |
| +++ src/heap.h (working copy) |
| @@ -1209,9 +1209,28 @@ |
| (PromotedSpaceSize() + PromotedExternalMemorySize()); |
| } |
| + static const intptr_t kMinimumPromotionLimit = |
| + 2 * (Page::kPageSize > MB ? Page::kPageSize : MB); |
| + static const intptr_t kMinimumAllocationLimit = |
| + 8 * (Page::kPageSize > MB ? Page::kPageSize : MB); |
| + static inline intptr_t PromotionFactor(intptr_t size) { |
|
Vyacheslav Egorov (Chromium)
2011/08/11 15:11:34
More comments about this magical functions would b
Erik Corry
2011/08/11 16:09:08
This function does not exist any more.
|
| + return size + size / 3; |
| + } |
| + static inline intptr_t AllocationFactor(intptr_t size) { |
| + return size + size / 2; |
| + } |
| + |
| inline void LowerOldGenLimits(intptr_t bytes) { |
| - old_gen_promotion_limit_ -= bytes; |
| - old_gen_allocation_limit_ -= bytes; |
| + old_gen_promotion_limit_ = |
| + Max(old_gen_promotion_limit_ - |
| + PromotionFactor(bytes) * old_gen_limit_factor_, |
|
Vyacheslav Egorov (Chromium)
2011/08/11 15:11:34
multiplying factor by factor. confusing. more comm
Erik Corry
2011/08/11 16:09:08
I was unable to find a better name, but I clarifie
|
| + (kMinimumAllocationLimit + new_space_.Capacity()) * |
| + old_gen_limit_factor_); |
| + old_gen_allocation_limit_ = |
| + Max(old_gen_allocation_limit_ - |
| + AllocationFactor(bytes) * old_gen_limit_factor_, |
| + (kMinimumAllocationLimit + new_space_.Capacity()) * |
| + old_gen_limit_factor_); |
| } |
| // Can be called when the embedding application is idle. |
| @@ -1458,6 +1477,10 @@ |
| // every allocation in large object space. |
| intptr_t old_gen_allocation_limit_; |
| + // Sometimes the heuristics dictate that those limits are increased. This |
| + // variable records that fact. |
| + int old_gen_limit_factor_; |
| + |
| // Limit on the amount of externally allocated memory allowed |
| // between global GCs. If reached a global GC is forced. |
| intptr_t external_allocation_limit_; |