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

Side by Side Diff: src/heap/gc-tracer.cc

Issue 1268933003: Memory reducer should use the current allocation rate instead of the overall allocation rate. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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/gc-tracer.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/heap/gc-tracer.h" 7 #include "src/heap/gc-tracer.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 } 695 }
696 696
697 697
698 size_t GCTracer::AllocationThroughputInBytesPerMillisecond( 698 size_t GCTracer::AllocationThroughputInBytesPerMillisecond(
699 double time_ms) const { 699 double time_ms) const {
700 return NewSpaceAllocationThroughputInBytesPerMillisecond(time_ms) + 700 return NewSpaceAllocationThroughputInBytesPerMillisecond(time_ms) +
701 OldGenerationAllocationThroughputInBytesPerMillisecond(time_ms); 701 OldGenerationAllocationThroughputInBytesPerMillisecond(time_ms);
702 } 702 }
703 703
704 704
705 size_t GCTracer::CurrentNewSpaceAllocationThroughputInBytesPerMillisecond()
706 const {
707 return NewSpaceAllocationThroughputInBytesPerMillisecond(
708 kThroughputTimeFrameMs);
709 }
710
711
705 size_t GCTracer::CurrentOldGenerationAllocationThroughputInBytesPerMillisecond() 712 size_t GCTracer::CurrentOldGenerationAllocationThroughputInBytesPerMillisecond()
706 const { 713 const {
707 static const double kThroughputTimeFrame = 5000;
708 return OldGenerationAllocationThroughputInBytesPerMillisecond( 714 return OldGenerationAllocationThroughputInBytesPerMillisecond(
709 kThroughputTimeFrame); 715 kThroughputTimeFrameMs);
710 } 716 }
711 717
712 718
713 double GCTracer::ContextDisposalRateInMilliseconds() const { 719 double GCTracer::ContextDisposalRateInMilliseconds() const {
714 if (context_disposal_events_.size() < kRingBufferMaxSize) return 0.0; 720 if (context_disposal_events_.size() < kRingBufferMaxSize) return 0.0;
715 721
716 double begin = base::OS::TimeCurrentMillis(); 722 double begin = base::OS::TimeCurrentMillis();
717 double end = 0.0; 723 double end = 0.0;
718 ContextDisposalEventBuffer::const_iterator iter = 724 ContextDisposalEventBuffer::const_iterator iter =
719 context_disposal_events_.begin(); 725 context_disposal_events_.begin();
(...skipping 21 matching lines...) Expand all
741 747
742 748
743 bool GCTracer::SurvivalEventsRecorded() const { 749 bool GCTracer::SurvivalEventsRecorded() const {
744 return survival_events_.size() > 0; 750 return survival_events_.size() > 0;
745 } 751 }
746 752
747 753
748 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); } 754 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); }
749 } // namespace internal 755 } // namespace internal
750 } // namespace v8 756 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/gc-tracer.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698