Chromium Code Reviews| 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 #ifndef V8_HEAP_INL_H_ | 5 #ifndef V8_HEAP_INL_H_ |
| 6 #define V8_HEAP_INL_H_ | 6 #define V8_HEAP_INL_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 | 9 |
| 10 #include "src/heap.h" | 10 #include "src/heap.h" |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 534 if (change_in_bytes > 0) { | 534 if (change_in_bytes > 0) { |
| 535 // Avoid overflow. | 535 // Avoid overflow. |
| 536 if (amount > amount_of_external_allocated_memory_) { | 536 if (amount > amount_of_external_allocated_memory_) { |
| 537 amount_of_external_allocated_memory_ = amount; | 537 amount_of_external_allocated_memory_ = amount; |
| 538 } else { | 538 } else { |
| 539 // Give up and reset the counters in case of an overflow. | 539 // Give up and reset the counters in case of an overflow. |
| 540 amount_of_external_allocated_memory_ = 0; | 540 amount_of_external_allocated_memory_ = 0; |
| 541 amount_of_external_allocated_memory_at_last_global_gc_ = 0; | 541 amount_of_external_allocated_memory_at_last_global_gc_ = 0; |
| 542 } | 542 } |
| 543 int64_t amount_since_last_global_gc = PromotedExternalMemorySize(); | 543 int64_t amount_since_last_global_gc = PromotedExternalMemorySize(); |
| 544 if (amount_since_last_global_gc > external_allocation_limit_) { | 544 if (amount_since_last_global_gc > 192 * MB) { |
|
Hannes Payer (out of office)
2014/06/04 11:24:49
192?
jochen (gone - plz use gerrit)
2014/06/04 11:41:24
external_allocation_limit_ is hard-coded to 192MB,
| |
| 545 CollectAllGarbage(kNoGCFlags, "external memory allocation limit reached"); | 545 CollectAllGarbage(kNoGCFlags, "external memory allocation limit reached"); |
| 546 } | 546 } |
| 547 } else { | 547 } else { |
| 548 // Avoid underflow. | 548 // Avoid underflow. |
| 549 if (amount >= 0) { | 549 if (amount >= 0) { |
| 550 amount_of_external_allocated_memory_ = amount; | 550 amount_of_external_allocated_memory_ = amount; |
| 551 } else { | 551 } else { |
| 552 // Give up and reset the counters in case of an underflow. | 552 // Give up and reset the counters in case of an underflow. |
| 553 amount_of_external_allocated_memory_ = 0; | 553 amount_of_external_allocated_memory_ = 0; |
| 554 amount_of_external_allocated_memory_at_last_global_gc_ = 0; | 554 amount_of_external_allocated_memory_at_last_global_gc_ = 0; |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 767 | 767 |
| 768 | 768 |
| 769 double GCTracer::SizeOfHeapObjects() { | 769 double GCTracer::SizeOfHeapObjects() { |
| 770 return (static_cast<double>(heap_->SizeOfObjects())) / MB; | 770 return (static_cast<double>(heap_->SizeOfObjects())) / MB; |
| 771 } | 771 } |
| 772 | 772 |
| 773 | 773 |
| 774 } } // namespace v8::internal | 774 } } // namespace v8::internal |
| 775 | 775 |
| 776 #endif // V8_HEAP_INL_H_ | 776 #endif // V8_HEAP_INL_H_ |
| OLD | NEW |