OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
446 static_cast<int>(SizeOfObjects())); | 446 static_cast<int>(SizeOfObjects())); |
447 | 447 |
448 isolate_->counters()->symbol_table_capacity()->Set( | 448 isolate_->counters()->symbol_table_capacity()->Set( |
449 symbol_table()->Capacity()); | 449 symbol_table()->Capacity()); |
450 isolate_->counters()->number_of_symbols()->Set( | 450 isolate_->counters()->number_of_symbols()->Set( |
451 symbol_table()->NumberOfElements()); | 451 symbol_table()->NumberOfElements()); |
452 | 452 |
453 if (CommittedMemory() > 0) { | 453 if (CommittedMemory() > 0) { |
454 isolate_->counters()->external_fragmentation_total()->AddSample( | 454 isolate_->counters()->external_fragmentation_total()->AddSample( |
455 static_cast<int>(100 - (SizeOfObjects() * 100.0) / CommittedMemory())); | 455 static_cast<int>(100 - (SizeOfObjects() * 100.0) / CommittedMemory())); |
456 | |
457 isolate_->counters()->map_space_fraction_of_total()->AddSample( | |
458 static_cast<int>( | |
459 (map_space()->CommittedMemory() * 100.0) / CommittedMemory())); | |
460 isolate_->counters()->cell_space_fraction_of_total()->AddSample( | |
461 static_cast<int>( | |
462 (cell_space()->CommittedMemory() * 100.0) / CommittedMemory())); | |
463 | |
464 isolate_->counters()->total_heap_size()->AddSample(CommittedMemory() / KB); | |
Michael Starzinger
2012/08/08 18:44:36
It doesn't make much of a difference, but we could
jochen (gone - plz use gerrit)
2012/08/09 13:31:29
We'd just keep adding 0 samples (probably during s
| |
465 isolate_->counters()->live_heap_size()->AddSample(SizeOfObjects() / KB); | |
466 isolate_->counters()->total_map_space_size()->AddSample( | |
467 map_space()->CommittedMemory() / KB); | |
468 isolate_->counters()->total_cell_space_size()->AddSample( | |
469 cell_space()->CommittedMemory() / KB); | |
456 } | 470 } |
457 | 471 |
458 #define UPDATE_COUNTERS_FOR_SPACE(space) \ | 472 #define UPDATE_COUNTERS_FOR_SPACE(space) \ |
459 isolate_->counters()->space##_bytes_available()->Set( \ | 473 isolate_->counters()->space##_bytes_available()->Set( \ |
460 static_cast<int>(space()->Available())); \ | 474 static_cast<int>(space()->Available())); \ |
461 isolate_->counters()->space##_bytes_committed()->Set( \ | 475 isolate_->counters()->space##_bytes_committed()->Set( \ |
462 static_cast<int>(space()->CommittedMemory())); \ | 476 static_cast<int>(space()->CommittedMemory())); \ |
463 isolate_->counters()->space##_bytes_used()->Set( \ | 477 isolate_->counters()->space##_bytes_used()->Set( \ |
464 static_cast<int>(space()->SizeOfObjects())); | 478 static_cast<int>(space()->SizeOfObjects())); |
465 #define UPDATE_FRAGMENTATION_FOR_SPACE(space) \ | 479 #define UPDATE_FRAGMENTATION_FOR_SPACE(space) \ |
(...skipping 6781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7247 static_cast<int>(object_sizes_last_time_[index])); | 7261 static_cast<int>(object_sizes_last_time_[index])); |
7248 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) | 7262 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) |
7249 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 7263 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
7250 | 7264 |
7251 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 7265 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
7252 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 7266 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
7253 ClearObjectStats(); | 7267 ClearObjectStats(); |
7254 } | 7268 } |
7255 | 7269 |
7256 } } // namespace v8::internal | 7270 } } // namespace v8::internal |
OLD | NEW |