| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/gc-tracer.h" | 5 #include "src/heap/gc-tracer.h" |
| 6 | 6 |
| 7 #include "src/counters.h" | 7 #include "src/counters.h" |
| 8 #include "src/heap/heap-inl.h" | 8 #include "src/heap/heap-inl.h" |
| 9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
| 10 | 10 |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 449 |
| 450 | 450 |
| 451 void GCTracer::PrintNVP() const { | 451 void GCTracer::PrintNVP() const { |
| 452 double duration = current_.end_time - current_.start_time; | 452 double duration = current_.end_time - current_.start_time; |
| 453 double spent_in_mutator = current_.start_time - previous_.end_time; | 453 double spent_in_mutator = current_.start_time - previous_.end_time; |
| 454 intptr_t allocated_since_last_gc = | 454 intptr_t allocated_since_last_gc = |
| 455 current_.start_object_size - previous_.end_object_size; | 455 current_.start_object_size - previous_.end_object_size; |
| 456 | 456 |
| 457 switch (current_.type) { | 457 switch (current_.type) { |
| 458 case Event::SCAVENGER: | 458 case Event::SCAVENGER: |
| 459 PrintIsolate(heap_->isolate(), | 459 PrintIsolate( |
| 460 "%8.0f ms: " | 460 heap_->isolate(), |
| 461 "pause=%.1f " | 461 "%8.0f ms: " |
| 462 "mutator=%.1f " | 462 "pause=%.1f " |
| 463 "gc=%s " | 463 "mutator=%.1f " |
| 464 "reduce_memory=%d " | 464 "gc=%s " |
| 465 "scavenge=%.2f " | 465 "reduce_memory=%d " |
| 466 "old_new=%.2f " | 466 "scavenge=%.2f " |
| 467 "weak=%.2f " | 467 "revive_marked_objects=%.2f " |
| 468 "roots=%.2f " | 468 "old_new=%.2f " |
| 469 "code=%.2f " | 469 "weak=%.2f " |
| 470 "semispace=%.2f " | 470 "roots=%.2f " |
| 471 "object_groups=%.2f " | 471 "code=%.2f " |
| 472 "external_prologue=%.2f " | 472 "semispace=%.2f " |
| 473 "external_epilogue=%.2f " | 473 "object_groups=%.2f " |
| 474 "external_weak_global_handles=%.2f " | 474 "external_prologue=%.2f " |
| 475 "steps_count=%d " | 475 "external_epilogue=%.2f " |
| 476 "steps_took=%.1f " | 476 "external_weak_global_handles=%.2f " |
| 477 "scavenge_throughput=%.f " | 477 "steps_count=%d " |
| 478 "total_size_before=%" V8PRIdPTR | 478 "steps_took=%.1f " |
| 479 " " | 479 "scavenge_throughput=%.f " |
| 480 "total_size_after=%" V8PRIdPTR | 480 "total_size_before=%" V8PRIdPTR |
| 481 " " | 481 " " |
| 482 "holes_size_before=%" V8PRIdPTR | 482 "total_size_after=%" V8PRIdPTR |
| 483 " " | 483 " " |
| 484 "holes_size_after=%" V8PRIdPTR | 484 "holes_size_before=%" V8PRIdPTR |
| 485 " " | 485 " " |
| 486 "allocated=%" V8PRIdPTR | 486 "holes_size_after=%" V8PRIdPTR |
| 487 " " | 487 " " |
| 488 "promoted=%" V8PRIdPTR | 488 "allocated=%" V8PRIdPTR |
| 489 " " | 489 " " |
| 490 "semi_space_copied=%" V8PRIdPTR | 490 "promoted=%" V8PRIdPTR |
| 491 " " | 491 " " |
| 492 "nodes_died_in_new=%d " | 492 "semi_space_copied=%" V8PRIdPTR |
| 493 "nodes_copied_in_new=%d " | 493 " " |
| 494 "nodes_promoted=%d " | 494 "nodes_died_in_new=%d " |
| 495 "promotion_ratio=%.1f%% " | 495 "nodes_copied_in_new=%d " |
| 496 "average_survival_ratio=%.1f%% " | 496 "nodes_promoted=%d " |
| 497 "promotion_rate=%.1f%% " | 497 "promotion_ratio=%.1f%% " |
| 498 "semi_space_copy_rate=%.1f%% " | 498 "average_survival_ratio=%.1f%% " |
| 499 "new_space_allocation_throughput=%.1f " | 499 "promotion_rate=%.1f%% " |
| 500 "context_disposal_rate=%.1f\n", | 500 "semi_space_copy_rate=%.1f%% " |
| 501 heap_->isolate()->time_millis_since_init(), duration, | 501 "new_space_allocation_throughput=%.1f " |
| 502 spent_in_mutator, current_.TypeName(true), | 502 "context_disposal_rate=%.1f\n", |
| 503 current_.reduce_memory, | 503 heap_->isolate()->time_millis_since_init(), duration, |
| 504 current_.scopes[Scope::SCAVENGER_SCAVENGE], | 504 spent_in_mutator, current_.TypeName(true), current_.reduce_memory, |
| 505 current_.scopes[Scope::SCAVENGER_OLD_TO_NEW_POINTERS], | 505 current_.scopes[Scope::SCAVENGER_SCAVENGE], |
| 506 current_.scopes[Scope::SCAVENGER_WEAK], | 506 current_.scopes[Scope::SCAVENGER_OBJECTS_MARKED_BY_MARK_COMPACT], |
| 507 current_.scopes[Scope::SCAVENGER_ROOTS], | 507 current_.scopes[Scope::SCAVENGER_OLD_TO_NEW_POINTERS], |
| 508 current_.scopes[Scope::SCAVENGER_CODE_FLUSH_CANDIDATES], | 508 current_.scopes[Scope::SCAVENGER_WEAK], |
| 509 current_.scopes[Scope::SCAVENGER_SEMISPACE], | 509 current_.scopes[Scope::SCAVENGER_ROOTS], |
| 510 current_.scopes[Scope::SCAVENGER_OBJECT_GROUPS], | 510 current_.scopes[Scope::SCAVENGER_CODE_FLUSH_CANDIDATES], |
| 511 current_.scopes[Scope::SCAVENGER_EXTERNAL_PROLOGUE], | 511 current_.scopes[Scope::SCAVENGER_SEMISPACE], |
| 512 current_.scopes[Scope::SCAVENGER_EXTERNAL_EPILOGUE], | 512 current_.scopes[Scope::SCAVENGER_OBJECT_GROUPS], |
| 513 current_.scopes[Scope::EXTERNAL_WEAK_GLOBAL_HANDLES], | 513 current_.scopes[Scope::SCAVENGER_EXTERNAL_PROLOGUE], |
| 514 current_.incremental_marking_steps, | 514 current_.scopes[Scope::SCAVENGER_EXTERNAL_EPILOGUE], |
| 515 current_.incremental_marking_duration, | 515 current_.scopes[Scope::EXTERNAL_WEAK_GLOBAL_HANDLES], |
| 516 ScavengeSpeedInBytesPerMillisecond(), | 516 current_.incremental_marking_steps, |
| 517 current_.start_object_size, current_.end_object_size, | 517 current_.incremental_marking_duration, |
| 518 current_.start_holes_size, current_.end_holes_size, | 518 ScavengeSpeedInBytesPerMillisecond(), current_.start_object_size, |
| 519 allocated_since_last_gc, heap_->promoted_objects_size(), | 519 current_.end_object_size, current_.start_holes_size, |
| 520 heap_->semi_space_copied_object_size(), | 520 current_.end_holes_size, allocated_since_last_gc, |
| 521 heap_->nodes_died_in_new_space_, | 521 heap_->promoted_objects_size(), |
| 522 heap_->nodes_copied_in_new_space_, heap_->nodes_promoted_, | 522 heap_->semi_space_copied_object_size(), |
| 523 heap_->promotion_ratio_, AverageSurvivalRatio(), | 523 heap_->nodes_died_in_new_space_, heap_->nodes_copied_in_new_space_, |
| 524 heap_->promotion_rate_, heap_->semi_space_copied_rate_, | 524 heap_->nodes_promoted_, heap_->promotion_ratio_, |
| 525 NewSpaceAllocationThroughputInBytesPerMillisecond(), | 525 AverageSurvivalRatio(), heap_->promotion_rate_, |
| 526 ContextDisposalRateInMilliseconds()); | 526 heap_->semi_space_copied_rate_, |
| 527 NewSpaceAllocationThroughputInBytesPerMillisecond(), |
| 528 ContextDisposalRateInMilliseconds()); |
| 527 break; | 529 break; |
| 528 case Event::MARK_COMPACTOR: | 530 case Event::MARK_COMPACTOR: |
| 529 case Event::INCREMENTAL_MARK_COMPACTOR: | 531 case Event::INCREMENTAL_MARK_COMPACTOR: |
| 530 PrintIsolate( | 532 PrintIsolate( |
| 531 heap_->isolate(), | 533 heap_->isolate(), |
| 532 "%8.0f ms: " | 534 "%8.0f ms: " |
| 533 "pause=%.1f " | 535 "pause=%.1f " |
| 534 "mutator=%.1f " | 536 "mutator=%.1f " |
| 535 "gc=%s " | 537 "gc=%s " |
| 536 "reduce_memory=%d " | 538 "reduce_memory=%d " |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 return sum / recorded_survival_ratios_.Count(); | 795 return sum / recorded_survival_ratios_.Count(); |
| 794 } | 796 } |
| 795 | 797 |
| 796 bool GCTracer::SurvivalEventsRecorded() const { | 798 bool GCTracer::SurvivalEventsRecorded() const { |
| 797 return recorded_survival_ratios_.Count() > 0; | 799 return recorded_survival_ratios_.Count() > 0; |
| 798 } | 800 } |
| 799 | 801 |
| 800 void GCTracer::ResetSurvivalEvents() { recorded_survival_ratios_.Reset(); } | 802 void GCTracer::ResetSurvivalEvents() { recorded_survival_ratios_.Reset(); } |
| 801 } // namespace internal | 803 } // namespace internal |
| 802 } // namespace v8 | 804 } // namespace v8 |
| OLD | NEW |