| OLD | NEW |
| 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/heap/heap.h" | 5 #include "src/heap/heap.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 5391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5402 | 5402 |
| 5403 int64_t Heap::PromotedExternalMemorySize() { | 5403 int64_t Heap::PromotedExternalMemorySize() { |
| 5404 if (amount_of_external_allocated_memory_ <= | 5404 if (amount_of_external_allocated_memory_ <= |
| 5405 amount_of_external_allocated_memory_at_last_global_gc_) | 5405 amount_of_external_allocated_memory_at_last_global_gc_) |
| 5406 return 0; | 5406 return 0; |
| 5407 return amount_of_external_allocated_memory_ - | 5407 return amount_of_external_allocated_memory_ - |
| 5408 amount_of_external_allocated_memory_at_last_global_gc_; | 5408 amount_of_external_allocated_memory_at_last_global_gc_; |
| 5409 } | 5409 } |
| 5410 | 5410 |
| 5411 | 5411 |
| 5412 const double Heap::kMinHeapGrowingFactor = 1.1; | |
| 5413 const double Heap::kMaxHeapGrowingFactor = 4.0; | |
| 5414 const double Heap::kMaxHeapGrowingFactorMemoryConstrained = 2.0; | |
| 5415 const double Heap::kMaxHeapGrowingFactorIdle = 1.5; | |
| 5416 const double Heap::kTargetMutatorUtilization = 0.97; | |
| 5417 | |
| 5418 | |
| 5419 // Given GC speed in bytes per ms, the allocation throughput in bytes per ms | 5412 // Given GC speed in bytes per ms, the allocation throughput in bytes per ms |
| 5420 // (mutator speed), this function returns the heap growing factor that will | 5413 // (mutator speed), this function returns the heap growing factor that will |
| 5421 // achieve the kTargetMutatorUtilisation if the GC speed and the mutator speed | 5414 // achieve the kTargetMutatorUtilisation if the GC speed and the mutator speed |
| 5422 // remain the same until the next GC. | 5415 // remain the same until the next GC. |
| 5423 // | 5416 // |
| 5424 // For a fixed time-frame T = TM + TG, the mutator utilization is the ratio | 5417 // For a fixed time-frame T = TM + TG, the mutator utilization is the ratio |
| 5425 // TM / (TM + TG), where TM is the time spent in the mutator and TG is the | 5418 // TM / (TM + TG), where TM is the time spent in the mutator and TG is the |
| 5426 // time spent in the garbage collector. | 5419 // time spent in the garbage collector. |
| 5427 // | 5420 // |
| 5428 // Let MU be kTargetMutatorUtilisation, the desired mutator utilization for the | 5421 // Let MU be kTargetMutatorUtilisation, the desired mutator utilization for the |
| (...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6737 *object_type = "CODE_TYPE"; \ | 6730 *object_type = "CODE_TYPE"; \ |
| 6738 *object_sub_type = "CODE_AGE/" #name; \ | 6731 *object_sub_type = "CODE_AGE/" #name; \ |
| 6739 return true; | 6732 return true; |
| 6740 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6733 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
| 6741 #undef COMPARE_AND_RETURN_NAME | 6734 #undef COMPARE_AND_RETURN_NAME |
| 6742 } | 6735 } |
| 6743 return false; | 6736 return false; |
| 6744 } | 6737 } |
| 6745 } // namespace internal | 6738 } // namespace internal |
| 6746 } // namespace v8 | 6739 } // namespace v8 |
| OLD | NEW |