Revision: 11931 Author: [email protected] Date: Tue Jun 26 04:46:16 2012 Log: Expose more detailed memory statistics
Expose allocated and used byte counters for the different spaces. The goal is
to monitor those values both on page cycles and via UMA BUG=v8:2201 TEST=none Review URL: https://chromiumcodereview.appspot.com/10657022 Patch from Jochen Eisinger <[email protected]>. http://code.google.com/p/v8/source/detail?r=11931 Modified: /branches/bleeding_edge/src/heap.cc /branches/bleeding_edge/src/v8-counters.h ======================================= --- /branches/bleeding_edge/src/heap.cc Mon Jun 25 05:51:03 2012 +++ /branches/bleeding_edge/src/heap.cc Tue Jun 26 04:46:16 2012 @@ -444,6 +444,56 @@ symbol_table()->Capacity()); isolate_->counters()->number_of_symbols()->Set( symbol_table()->NumberOfElements()); + + isolate_->counters()->new_space_bytes_available()->Set( + static_cast<int>(new_space()->Available())); + isolate_->counters()->new_space_bytes_committed()->Set( + static_cast<int>(new_space()->CommittedMemory())); + isolate_->counters()->new_space_bytes_used()->Set( + static_cast<int>(new_space()->SizeOfObjects())); + + isolate_->counters()->old_pointer_space_bytes_available()->Set( + static_cast<int>(old_pointer_space()->Available())); + isolate_->counters()->old_pointer_space_bytes_committed()->Set( + static_cast<int>(old_pointer_space()->CommittedMemory())); + isolate_->counters()->old_pointer_space_bytes_used()->Set( + static_cast<int>(old_pointer_space()->SizeOfObjects())); + + isolate_->counters()->old_data_space_bytes_available()->Set( + static_cast<int>(old_data_space()->Available())); + isolate_->counters()->old_data_space_bytes_committed()->Set( + static_cast<int>(old_data_space()->CommittedMemory())); + isolate_->counters()->old_data_space_bytes_used()->Set( + static_cast<int>(old_data_space()->SizeOfObjects())); + + isolate_->counters()->code_space_bytes_available()->Set( + static_cast<int>(code_space()->Available())); + isolate_->counters()->code_space_bytes_committed()->Set( + static_cast<int>(code_space()->CommittedMemory())); + isolate_->counters()->code_space_bytes_used()->Set( + static_cast<int>(code_space()->SizeOfObjects())); + + isolate_->counters()->map_space_bytes_available()->Set( + static_cast<int>(map_space()->Available())); + isolate_->counters()->map_space_bytes_committed()->Set( + static_cast<int>(map_space()->CommittedMemory())); + isolate_->counters()->map_space_bytes_used()->Set( + static_cast<int>(map_space()->SizeOfObjects())); + + isolate_->counters()->cell_space_bytes_available()->Set( + static_cast<int>(cell_space()->Available())); + isolate_->counters()->cell_space_bytes_committed()->Set( + static_cast<int>(cell_space()->CommittedMemory())); + isolate_->counters()->cell_space_bytes_used()->Set( + static_cast<int>(cell_space()->SizeOfObjects())); + + isolate_->counters()->lo_space_bytes_available()->Set( + static_cast<int>(lo_space()->Available())); + isolate_->counters()->lo_space_bytes_committed()->Set( + static_cast<int>(lo_space()->CommittedMemory())); + isolate_->counters()->lo_space_bytes_used()->Set( + static_cast<int>(lo_space()->SizeOfObjects())); + #if defined(DEBUG) ReportStatisticsAfterGC(); #endif // DEBUG ======================================= --- /branches/bleeding_edge/src/v8-counters.h Thu Jun 14 07:06:22 2012 +++ /branches/bleeding_edge/src/v8-counters.h Tue Jun 26 04:46:16 2012 @@ -246,7 +246,30 @@ SC(smi_checks_removed, V8.SmiChecksRemoved) \ SC(map_checks_removed, V8.MapChecksRemoved) \ SC(quote_json_char_count, V8.QuoteJsonCharacterCount) \ - SC(quote_json_char_recount, V8.QuoteJsonCharacterReCount) + SC(quote_json_char_recount, V8.QuoteJsonCharacterReCount) \ + SC(new_space_bytes_available, V8.MemoryNewSpaceBytesAvailable) \ + SC(new_space_bytes_committed, V8.MemoryNewSpaceBytesCommitted) \ + SC(new_space_bytes_used, V8.MemoryNewSpaceBytesUsed) \ + SC(old_pointer_space_bytes_available, \ + V8.MemoryOldPointerSpaceBytesAvailable) \ + SC(old_pointer_space_bytes_committed, \ + V8.MemoryOldPointerSpaceBytesCommitted) \ + SC(old_pointer_space_bytes_used, V8.MemoryOldPointerSpaceBytesUsed) \ + SC(old_data_space_bytes_available, V8.MemoryOldDataSpaceBytesAvailable) \ + SC(old_data_space_bytes_committed, V8.MemoryOldDataSpaceBytesCommitted) \ + SC(old_data_space_bytes_used, V8.MemoryOldDataSpaceBytesUsed) \ + SC(code_space_bytes_available, V8.MemoryCodeSpaceBytesAvailable) \ + SC(code_space_bytes_committed, V8.MemoryCodeSpaceBytesCommitted) \ + SC(code_space_bytes_used, V8.MemoryCodeSpaceBytesUsed) \ + SC(map_space_bytes_available, V8.MemoryMapSpaceBytesAvailable) \ + SC(map_space_bytes_committed, V8.MemoryMapSpaceBytesCommitted) \ + SC(map_space_bytes_used, V8.MemoryMapSpaceBytesUsed) \ + SC(cell_space_bytes_available, V8.MemoryCellSpaceBytesAvailable) \ + SC(cell_space_bytes_committed, V8.MemoryCellSpaceBytesCommitted) \ + SC(cell_space_bytes_used, V8.MemoryCellSpaceBytesUsed) \ + SC(lo_space_bytes_available, V8.MemoryLoSpaceBytesAvailable) \ + SC(lo_space_bytes_committed, V8.MemoryLoSpaceBytesCommitted) \ + SC(lo_space_bytes_used, V8.MemoryLoSpaceBytesUsed) // This file contains all the v8 counters that are in use. -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
