Add histograms for total allocated/live heap size, as well as allocated size...

Add histograms for total allocated/live heap size, as well as allocated size and percentage of total for map and cell

BUG=none
TEST=none
R=mstarzinger@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10854043
Patch from Jochen Eisinger <jochen@chromium.org>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12291 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 3646df7d
......@@ -453,6 +453,22 @@ void Heap::GarbageCollectionEpilogue() {
if (CommittedMemory() > 0) {
isolate_->counters()->external_fragmentation_total()->AddSample(
static_cast<int>(100 - (SizeOfObjects() * 100.0) / CommittedMemory()));
isolate_->counters()->heap_fraction_map_space()->AddSample(
static_cast<int>(
(map_space()->CommittedMemory() * 100.0) / CommittedMemory()));
isolate_->counters()->heap_fraction_cell_space()->AddSample(
static_cast<int>(
(cell_space()->CommittedMemory() * 100.0) / CommittedMemory()));
isolate_->counters()->heap_sample_total_committed()->AddSample(
CommittedMemory() / KB);
isolate_->counters()->heap_sample_total_used()->AddSample(
SizeOfObjects() / KB);
isolate_->counters()->heap_sample_map_space_committed()->AddSample(
map_space()->CommittedMemory() / KB);
isolate_->counters()->heap_sample_cell_space_committed()->AddSample(
cell_space()->CommittedMemory() / KB);
}
#define UPDATE_COUNTERS_FOR_SPACE(space) \
......
......@@ -45,6 +45,12 @@ Counters::Counters() {
HISTOGRAM_PERCENTAGE_LIST(HP)
#undef HP
#define HM(name, caption) \
Histogram name = { #caption, 1000, 500000, 50, NULL, false }; \
name##_ = name;
HISTOGRAM_MEMORY_LIST(HM)
#undef HM
#define SC(name, caption) \
StatsCounter name = { "c:" #caption, NULL, false };\
name##_ = name;
......@@ -101,6 +107,10 @@ void Counters::ResetHistograms() {
#define HP(name, caption) name##_.Reset();
HISTOGRAM_PERCENTAGE_LIST(HP)
#undef HP
#define HM(name, caption) name##_.Reset();
HISTOGRAM_MEMORY_LIST(HM)
#undef HM
}
} } // namespace v8::internal
......@@ -65,7 +65,20 @@ namespace internal {
HP(external_fragmentation_cell_space, \
V8.MemoryExternalFragmentationCellSpace) \
HP(external_fragmentation_lo_space, \
V8.MemoryExternalFragmentationLoSpace)
V8.MemoryExternalFragmentationLoSpace) \
HP(heap_fraction_map_space, \
V8.MemoryHeapFractionMapSpace) \
HP(heap_fraction_cell_space, \
V8.MemoryHeapFractionCellSpace) \
#define HISTOGRAM_MEMORY_LIST(HM) \
HM(heap_sample_total_committed, V8.MemoryHeapSampleTotalCommitted) \
HM(heap_sample_total_used, V8.MemoryHeapSampleTotalUsed) \
HM(heap_sample_map_space_committed, \
V8.MemoryHeapSampleMapSpaceCommitted) \
HM(heap_sample_cell_space_committed, \
V8.MemoryHeapSampleCellSpaceCommitted)
// WARNING: STATS_COUNTER_LIST_* is a very large macro that is causing MSVC
......@@ -303,6 +316,11 @@ class Counters {
HISTOGRAM_PERCENTAGE_LIST(HP)
#undef HP
#define HM(name, caption) \
Histogram* name() { return &name##_; }
HISTOGRAM_MEMORY_LIST(HM)
#undef HM
#define SC(name, caption) \
StatsCounter* name() { return &name##_; }
STATS_COUNTER_LIST_1(SC)
......@@ -338,6 +356,9 @@ class Counters {
#define PERCENTAGE_ID(name, caption) k_##name,
HISTOGRAM_PERCENTAGE_LIST(PERCENTAGE_ID)
#undef PERCENTAGE_ID
#define MEMORY_ID(name, caption) k_##name,
HISTOGRAM_MEMORY_LIST(MEMORY_ID)
#undef MEMORY_ID
#define COUNTER_ID(name, caption) k_##name,
STATS_COUNTER_LIST_1(COUNTER_ID)
STATS_COUNTER_LIST_2(COUNTER_ID)
......@@ -376,6 +397,11 @@ class Counters {
HISTOGRAM_PERCENTAGE_LIST(HP)
#undef HP
#define HM(name, caption) \
Histogram name##_;
HISTOGRAM_MEMORY_LIST(HM)
#undef HM
#define SC(name, caption) \
StatsCounter name##_;
STATS_COUNTER_LIST_1(SC)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment