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

Side by Side Diff: src/heap.cc

Issue 10657022: Expose more detailed memory statistics (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 8 years, 5 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 | « no previous file | 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 if (FLAG_code_stats) ReportCodeStatistics("After GC"); 437 if (FLAG_code_stats) ReportCodeStatistics("After GC");
438 #endif 438 #endif
439 439
440 isolate_->counters()->alive_after_last_gc()->Set( 440 isolate_->counters()->alive_after_last_gc()->Set(
441 static_cast<int>(SizeOfObjects())); 441 static_cast<int>(SizeOfObjects()));
442 442
443 isolate_->counters()->symbol_table_capacity()->Set( 443 isolate_->counters()->symbol_table_capacity()->Set(
444 symbol_table()->Capacity()); 444 symbol_table()->Capacity());
445 isolate_->counters()->number_of_symbols()->Set( 445 isolate_->counters()->number_of_symbols()->Set(
446 symbol_table()->NumberOfElements()); 446 symbol_table()->NumberOfElements());
447
448 isolate_->counters()->new_space_bytes_available()->Set(
449 static_cast<int>(new_space()->Available()));
450 isolate_->counters()->new_space_bytes_committed()->Set(
451 static_cast<int>(new_space()->CommittedMemory()));
452 isolate_->counters()->new_space_bytes_used()->Set(
453 static_cast<int>(new_space()->SizeOfObjects()));
454
455 isolate_->counters()->old_pointer_space_bytes_available()->Set(
456 static_cast<int>(old_pointer_space()->Available()));
457 isolate_->counters()->old_pointer_space_bytes_committed()->Set(
458 static_cast<int>(old_pointer_space()->CommittedMemory()));
459 isolate_->counters()->old_pointer_space_bytes_used()->Set(
460 static_cast<int>(old_pointer_space()->SizeOfObjects()));
461
462 isolate_->counters()->old_data_space_bytes_available()->Set(
463 static_cast<int>(old_data_space()->Available()));
464 isolate_->counters()->old_data_space_bytes_committed()->Set(
465 static_cast<int>(old_data_space()->CommittedMemory()));
466 isolate_->counters()->old_data_space_bytes_used()->Set(
467 static_cast<int>(old_data_space()->SizeOfObjects()));
468
469 isolate_->counters()->code_space_bytes_available()->Set(
470 static_cast<int>(code_space()->Available()));
471 isolate_->counters()->code_space_bytes_committed()->Set(
472 static_cast<int>(code_space()->CommittedMemory()));
473 isolate_->counters()->code_space_bytes_used()->Set(
474 static_cast<int>(code_space()->SizeOfObjects()));
475
476 isolate_->counters()->map_space_bytes_available()->Set(
477 static_cast<int>(map_space()->Available()));
478 isolate_->counters()->map_space_bytes_committed()->Set(
479 static_cast<int>(map_space()->CommittedMemory()));
480 isolate_->counters()->map_space_bytes_used()->Set(
481 static_cast<int>(map_space()->SizeOfObjects()));
482
483 isolate_->counters()->cell_space_bytes_available()->Set(
484 static_cast<int>(cell_space()->Available()));
485 isolate_->counters()->cell_space_bytes_committed()->Set(
486 static_cast<int>(cell_space()->CommittedMemory()));
487 isolate_->counters()->cell_space_bytes_used()->Set(
488 static_cast<int>(cell_space()->SizeOfObjects()));
489
490 isolate_->counters()->lo_space_bytes_available()->Set(
491 static_cast<int>(lo_space()->Available()));
492 isolate_->counters()->lo_space_bytes_committed()->Set(
493 static_cast<int>(lo_space()->CommittedMemory()));
494 isolate_->counters()->lo_space_bytes_used()->Set(
495 static_cast<int>(lo_space()->SizeOfObjects()));
496
447 #if defined(DEBUG) 497 #if defined(DEBUG)
448 ReportStatisticsAfterGC(); 498 ReportStatisticsAfterGC();
449 #endif // DEBUG 499 #endif // DEBUG
450 #ifdef ENABLE_DEBUGGER_SUPPORT 500 #ifdef ENABLE_DEBUGGER_SUPPORT
451 isolate_->debug()->AfterGarbageCollection(); 501 isolate_->debug()->AfterGarbageCollection();
452 #endif // ENABLE_DEBUGGER_SUPPORT 502 #endif // ENABLE_DEBUGGER_SUPPORT
453 } 503 }
454 504
455 505
456 void Heap::CollectAllGarbage(int flags, const char* gc_reason) { 506 void Heap::CollectAllGarbage(int flags, const char* gc_reason) {
(...skipping 6714 matching lines...) Expand 10 before | Expand all | Expand 10 after
7171 } else { 7221 } else {
7172 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. 7222 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died.
7173 } 7223 }
7174 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = 7224 remembered_unmapped_pages_[remembered_unmapped_pages_index_] =
7175 reinterpret_cast<Address>(p); 7225 reinterpret_cast<Address>(p);
7176 remembered_unmapped_pages_index_++; 7226 remembered_unmapped_pages_index_++;
7177 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; 7227 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages;
7178 } 7228 }
7179 7229
7180 } } // namespace v8::internal 7230 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/v8-counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698