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

Side by Side Diff: src/heap.cc

Issue 27023003: Add histograms to track fraction of heap spaces and percentage of crankshaft code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add comment Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/heap.h ('k') | src/v8-counters.h » ('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 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 sweeping_time_(0.0), 134 sweeping_time_(0.0),
135 store_buffer_(this), 135 store_buffer_(this),
136 marking_(this), 136 marking_(this),
137 incremental_marking_(this), 137 incremental_marking_(this),
138 number_idle_notifications_(0), 138 number_idle_notifications_(0),
139 last_idle_notification_gc_count_(0), 139 last_idle_notification_gc_count_(0),
140 last_idle_notification_gc_count_init_(false), 140 last_idle_notification_gc_count_init_(false),
141 mark_sweeps_since_idle_round_started_(0), 141 mark_sweeps_since_idle_round_started_(0),
142 gc_count_at_last_idle_gc_(0), 142 gc_count_at_last_idle_gc_(0),
143 scavenges_since_last_idle_round_(kIdleScavengeThreshold), 143 scavenges_since_last_idle_round_(kIdleScavengeThreshold),
144 full_codegen_bytes_generated_(0),
145 crankshaft_codegen_bytes_generated_(0),
144 gcs_since_last_deopt_(0), 146 gcs_since_last_deopt_(0),
145 #ifdef VERIFY_HEAP 147 #ifdef VERIFY_HEAP
146 no_weak_object_verification_scope_depth_(0), 148 no_weak_object_verification_scope_depth_(0),
147 #endif 149 #endif
148 promotion_queue_(this), 150 promotion_queue_(this),
149 configured_(false), 151 configured_(false),
150 chunks_queued_for_free_(NULL), 152 chunks_queued_for_free_(NULL),
151 relocation_mutex_(NULL) { 153 relocation_mutex_(NULL) {
152 // Allow build-time customization of the max semispace size. Building 154 // Allow build-time customization of the max semispace size. Building
153 // V8 with snapshots and a non-default max semispace size is much 155 // V8 with snapshots and a non-default max semispace size is much
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 } 503 }
502 504
503 isolate_->counters()->alive_after_last_gc()->Set( 505 isolate_->counters()->alive_after_last_gc()->Set(
504 static_cast<int>(SizeOfObjects())); 506 static_cast<int>(SizeOfObjects()));
505 507
506 isolate_->counters()->string_table_capacity()->Set( 508 isolate_->counters()->string_table_capacity()->Set(
507 string_table()->Capacity()); 509 string_table()->Capacity());
508 isolate_->counters()->number_of_symbols()->Set( 510 isolate_->counters()->number_of_symbols()->Set(
509 string_table()->NumberOfElements()); 511 string_table()->NumberOfElements());
510 512
513 if (full_codegen_bytes_generated_ + crankshaft_codegen_bytes_generated_ > 0) {
514 isolate_->counters()->codegen_fraction_crankshaft()->AddSample(
515 static_cast<int>((crankshaft_codegen_bytes_generated_ * 100.0) /
516 (crankshaft_codegen_bytes_generated_
517 + full_codegen_bytes_generated_)));
518 }
519
511 if (CommittedMemory() > 0) { 520 if (CommittedMemory() > 0) {
512 isolate_->counters()->external_fragmentation_total()->AddSample( 521 isolate_->counters()->external_fragmentation_total()->AddSample(
513 static_cast<int>(100 - (SizeOfObjects() * 100.0) / CommittedMemory())); 522 static_cast<int>(100 - (SizeOfObjects() * 100.0) / CommittedMemory()));
514 523
524 isolate_->counters()->heap_fraction_new_space()->
525 AddSample(static_cast<int>(
526 (new_space()->CommittedMemory() * 100.0) / CommittedMemory()));
527 isolate_->counters()->heap_fraction_old_pointer_space()->AddSample(
528 static_cast<int>(
529 (old_pointer_space()->CommittedMemory() * 100.0) /
530 CommittedMemory()));
531 isolate_->counters()->heap_fraction_old_data_space()->AddSample(
532 static_cast<int>(
533 (old_data_space()->CommittedMemory() * 100.0) /
534 CommittedMemory()));
535 isolate_->counters()->heap_fraction_code_space()->
536 AddSample(static_cast<int>(
537 (code_space()->CommittedMemory() * 100.0) / CommittedMemory()));
515 isolate_->counters()->heap_fraction_map_space()->AddSample( 538 isolate_->counters()->heap_fraction_map_space()->AddSample(
516 static_cast<int>( 539 static_cast<int>(
517 (map_space()->CommittedMemory() * 100.0) / CommittedMemory())); 540 (map_space()->CommittedMemory() * 100.0) / CommittedMemory()));
518 isolate_->counters()->heap_fraction_cell_space()->AddSample( 541 isolate_->counters()->heap_fraction_cell_space()->AddSample(
519 static_cast<int>( 542 static_cast<int>(
520 (cell_space()->CommittedMemory() * 100.0) / CommittedMemory())); 543 (cell_space()->CommittedMemory() * 100.0) / CommittedMemory()));
521 isolate_->counters()->heap_fraction_property_cell_space()-> 544 isolate_->counters()->heap_fraction_property_cell_space()->
522 AddSample(static_cast<int>( 545 AddSample(static_cast<int>(
523 (property_cell_space()->CommittedMemory() * 100.0) / 546 (property_cell_space()->CommittedMemory() * 100.0) /
524 CommittedMemory())); 547 CommittedMemory()));
548 isolate_->counters()->heap_fraction_lo_space()->
549 AddSample(static_cast<int>(
550 (lo_space()->CommittedMemory() * 100.0) / CommittedMemory()));
525 551
526 isolate_->counters()->heap_sample_total_committed()->AddSample( 552 isolate_->counters()->heap_sample_total_committed()->AddSample(
527 static_cast<int>(CommittedMemory() / KB)); 553 static_cast<int>(CommittedMemory() / KB));
528 isolate_->counters()->heap_sample_total_used()->AddSample( 554 isolate_->counters()->heap_sample_total_used()->AddSample(
529 static_cast<int>(SizeOfObjects() / KB)); 555 static_cast<int>(SizeOfObjects() / KB));
530 isolate_->counters()->heap_sample_map_space_committed()->AddSample( 556 isolate_->counters()->heap_sample_map_space_committed()->AddSample(
531 static_cast<int>(map_space()->CommittedMemory() / KB)); 557 static_cast<int>(map_space()->CommittedMemory() / KB));
532 isolate_->counters()->heap_sample_cell_space_committed()->AddSample( 558 isolate_->counters()->heap_sample_cell_space_committed()->AddSample(
533 static_cast<int>(cell_space()->CommittedMemory() / KB)); 559 static_cast<int>(cell_space()->CommittedMemory() / KB));
534 isolate_->counters()-> 560 isolate_->counters()->
535 heap_sample_property_cell_space_committed()-> 561 heap_sample_property_cell_space_committed()->
536 AddSample(static_cast<int>( 562 AddSample(static_cast<int>(
537 property_cell_space()->CommittedMemory() / KB)); 563 property_cell_space()->CommittedMemory() / KB));
564 isolate_->counters()->heap_sample_code_space_committed()->AddSample(
565 static_cast<int>(code_space()->CommittedMemory() / KB));
538 } 566 }
539 567
540 #define UPDATE_COUNTERS_FOR_SPACE(space) \ 568 #define UPDATE_COUNTERS_FOR_SPACE(space) \
541 isolate_->counters()->space##_bytes_available()->Set( \ 569 isolate_->counters()->space##_bytes_available()->Set( \
542 static_cast<int>(space()->Available())); \ 570 static_cast<int>(space()->Available())); \
543 isolate_->counters()->space##_bytes_committed()->Set( \ 571 isolate_->counters()->space##_bytes_committed()->Set( \
544 static_cast<int>(space()->CommittedMemory())); \ 572 static_cast<int>(space()->CommittedMemory())); \
545 isolate_->counters()->space##_bytes_used()->Set( \ 573 isolate_->counters()->space##_bytes_used()->Set( \
546 static_cast<int>(space()->SizeOfObjects())); 574 static_cast<int>(space()->SizeOfObjects()));
547 #define UPDATE_FRAGMENTATION_FOR_SPACE(space) \ 575 #define UPDATE_FRAGMENTATION_FOR_SPACE(space) \
(...skipping 7354 matching lines...) Expand 10 before | Expand all | Expand 10 after
7902 if (FLAG_concurrent_recompilation) { 7930 if (FLAG_concurrent_recompilation) {
7903 heap_->relocation_mutex_->Lock(); 7931 heap_->relocation_mutex_->Lock();
7904 #ifdef DEBUG 7932 #ifdef DEBUG
7905 heap_->relocation_mutex_locked_by_optimizer_thread_ = 7933 heap_->relocation_mutex_locked_by_optimizer_thread_ =
7906 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread(); 7934 heap_->isolate()->optimizing_compiler_thread()->IsOptimizerThread();
7907 #endif // DEBUG 7935 #endif // DEBUG
7908 } 7936 }
7909 } 7937 }
7910 7938
7911 } } // namespace v8::internal 7939 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.h ('k') | src/v8-counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698