comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 10290:05a17f270c7e

8014240: G1: Add remembered set size information to output of G1PrintRegionLivenessInfo Summary: Improve the output of G1PrintRegionLivenessInfo by adding a per-region remembered set size information column Reviewed-by: jwilhelm, johnc
author tschatzl
date Thu, 16 May 2013 13:02:33 +0200
parents b06ac540229e
children f2110083203d
comparison
equal deleted inserted replaced
10289:bed55d125e37 10290:05a17f270c7e
4513 G1PrintRegionLivenessInfoClosure(outputStream* out, const char* phase_name) 4513 G1PrintRegionLivenessInfoClosure(outputStream* out, const char* phase_name)
4514 : _out(out), 4514 : _out(out),
4515 _total_used_bytes(0), _total_capacity_bytes(0), 4515 _total_used_bytes(0), _total_capacity_bytes(0),
4516 _total_prev_live_bytes(0), _total_next_live_bytes(0), 4516 _total_prev_live_bytes(0), _total_next_live_bytes(0),
4517 _hum_used_bytes(0), _hum_capacity_bytes(0), 4517 _hum_used_bytes(0), _hum_capacity_bytes(0),
4518 _hum_prev_live_bytes(0), _hum_next_live_bytes(0) { 4518 _hum_prev_live_bytes(0), _hum_next_live_bytes(0),
4519 _total_remset_bytes(0) {
4519 G1CollectedHeap* g1h = G1CollectedHeap::heap(); 4520 G1CollectedHeap* g1h = G1CollectedHeap::heap();
4520 MemRegion g1_committed = g1h->g1_committed(); 4521 MemRegion g1_committed = g1h->g1_committed();
4521 MemRegion g1_reserved = g1h->g1_reserved(); 4522 MemRegion g1_reserved = g1h->g1_reserved();
4522 double now = os::elapsedTime(); 4523 double now = os::elapsedTime();
4523 4524
4531 g1_committed.start(), g1_committed.end(), 4532 g1_committed.start(), g1_committed.end(),
4532 g1_reserved.start(), g1_reserved.end(), 4533 g1_reserved.start(), g1_reserved.end(),
4533 HeapRegion::GrainBytes); 4534 HeapRegion::GrainBytes);
4534 _out->print_cr(G1PPRL_LINE_PREFIX); 4535 _out->print_cr(G1PPRL_LINE_PREFIX);
4535 _out->print_cr(G1PPRL_LINE_PREFIX 4536 _out->print_cr(G1PPRL_LINE_PREFIX
4536 G1PPRL_TYPE_H_FORMAT 4537 G1PPRL_TYPE_H_FORMAT
4537 G1PPRL_ADDR_BASE_H_FORMAT 4538 G1PPRL_ADDR_BASE_H_FORMAT
4538 G1PPRL_BYTE_H_FORMAT 4539 G1PPRL_BYTE_H_FORMAT
4539 G1PPRL_BYTE_H_FORMAT 4540 G1PPRL_BYTE_H_FORMAT
4540 G1PPRL_BYTE_H_FORMAT 4541 G1PPRL_BYTE_H_FORMAT
4541 G1PPRL_DOUBLE_H_FORMAT, 4542 G1PPRL_DOUBLE_H_FORMAT
4542 "type", "address-range", 4543 G1PPRL_BYTE_H_FORMAT,
4543 "used", "prev-live", "next-live", "gc-eff"); 4544 "type", "address-range",
4545 "used", "prev-live", "next-live", "gc-eff", "remset");
4544 _out->print_cr(G1PPRL_LINE_PREFIX 4546 _out->print_cr(G1PPRL_LINE_PREFIX
4545 G1PPRL_TYPE_H_FORMAT 4547 G1PPRL_TYPE_H_FORMAT
4546 G1PPRL_ADDR_BASE_H_FORMAT 4548 G1PPRL_ADDR_BASE_H_FORMAT
4547 G1PPRL_BYTE_H_FORMAT 4549 G1PPRL_BYTE_H_FORMAT
4548 G1PPRL_BYTE_H_FORMAT 4550 G1PPRL_BYTE_H_FORMAT
4549 G1PPRL_BYTE_H_FORMAT 4551 G1PPRL_BYTE_H_FORMAT
4550 G1PPRL_DOUBLE_H_FORMAT, 4552 G1PPRL_DOUBLE_H_FORMAT
4551 "", "", 4553 G1PPRL_BYTE_H_FORMAT,
4552 "(bytes)", "(bytes)", "(bytes)", "(bytes/ms)"); 4554 "", "",
4555 "(bytes)", "(bytes)", "(bytes)", "(bytes/ms)", "(bytes)");
4553 } 4556 }
4554 4557
4555 // It takes as a parameter a reference to one of the _hum_* fields, it 4558 // It takes as a parameter a reference to one of the _hum_* fields, it
4556 // deduces the corresponding value for a region in a humongous region 4559 // deduces the corresponding value for a region in a humongous region
4557 // series (either the region size, or what's left if the _hum_* field 4560 // series (either the region size, or what's left if the _hum_* field
4589 size_t capacity_bytes = r->capacity(); 4592 size_t capacity_bytes = r->capacity();
4590 size_t used_bytes = r->used(); 4593 size_t used_bytes = r->used();
4591 size_t prev_live_bytes = r->live_bytes(); 4594 size_t prev_live_bytes = r->live_bytes();
4592 size_t next_live_bytes = r->next_live_bytes(); 4595 size_t next_live_bytes = r->next_live_bytes();
4593 double gc_eff = r->gc_efficiency(); 4596 double gc_eff = r->gc_efficiency();
4597 size_t remset_bytes = r->rem_set()->mem_size();
4594 if (r->used() == 0) { 4598 if (r->used() == 0) {
4595 type = "FREE"; 4599 type = "FREE";
4596 } else if (r->is_survivor()) { 4600 } else if (r->is_survivor()) {
4597 type = "SURV"; 4601 type = "SURV";
4598 } else if (r->is_young()) { 4602 } else if (r->is_young()) {
4622 4626
4623 _total_used_bytes += used_bytes; 4627 _total_used_bytes += used_bytes;
4624 _total_capacity_bytes += capacity_bytes; 4628 _total_capacity_bytes += capacity_bytes;
4625 _total_prev_live_bytes += prev_live_bytes; 4629 _total_prev_live_bytes += prev_live_bytes;
4626 _total_next_live_bytes += next_live_bytes; 4630 _total_next_live_bytes += next_live_bytes;
4631 _total_remset_bytes += remset_bytes;
4627 4632
4628 // Print a line for this particular region. 4633 // Print a line for this particular region.
4629 _out->print_cr(G1PPRL_LINE_PREFIX 4634 _out->print_cr(G1PPRL_LINE_PREFIX
4630 G1PPRL_TYPE_FORMAT 4635 G1PPRL_TYPE_FORMAT
4631 G1PPRL_ADDR_BASE_FORMAT 4636 G1PPRL_ADDR_BASE_FORMAT
4632 G1PPRL_BYTE_FORMAT 4637 G1PPRL_BYTE_FORMAT
4633 G1PPRL_BYTE_FORMAT 4638 G1PPRL_BYTE_FORMAT
4634 G1PPRL_BYTE_FORMAT 4639 G1PPRL_BYTE_FORMAT
4635 G1PPRL_DOUBLE_FORMAT, 4640 G1PPRL_DOUBLE_FORMAT
4641 G1PPRL_BYTE_FORMAT,
4636 type, bottom, end, 4642 type, bottom, end,
4637 used_bytes, prev_live_bytes, next_live_bytes, gc_eff); 4643 used_bytes, prev_live_bytes, next_live_bytes, gc_eff , remset_bytes);
4638 4644
4639 return false; 4645 return false;
4640 } 4646 }
4641 4647
4642 G1PrintRegionLivenessInfoClosure::~G1PrintRegionLivenessInfoClosure() { 4648 G1PrintRegionLivenessInfoClosure::~G1PrintRegionLivenessInfoClosure() {
4649 // add static memory usages to remembered set sizes
4650 _total_remset_bytes += HeapRegionRemSet::fl_mem_size() + HeapRegionRemSet::static_mem_size();
4643 // Print the footer of the output. 4651 // Print the footer of the output.
4644 _out->print_cr(G1PPRL_LINE_PREFIX); 4652 _out->print_cr(G1PPRL_LINE_PREFIX);
4645 _out->print_cr(G1PPRL_LINE_PREFIX 4653 _out->print_cr(G1PPRL_LINE_PREFIX
4646 " SUMMARY" 4654 " SUMMARY"
4647 G1PPRL_SUM_MB_FORMAT("capacity") 4655 G1PPRL_SUM_MB_FORMAT("capacity")
4648 G1PPRL_SUM_MB_PERC_FORMAT("used") 4656 G1PPRL_SUM_MB_PERC_FORMAT("used")
4649 G1PPRL_SUM_MB_PERC_FORMAT("prev-live") 4657 G1PPRL_SUM_MB_PERC_FORMAT("prev-live")
4650 G1PPRL_SUM_MB_PERC_FORMAT("next-live"), 4658 G1PPRL_SUM_MB_PERC_FORMAT("next-live")
4659 G1PPRL_SUM_MB_FORMAT("remset"),
4651 bytes_to_mb(_total_capacity_bytes), 4660 bytes_to_mb(_total_capacity_bytes),
4652 bytes_to_mb(_total_used_bytes), 4661 bytes_to_mb(_total_used_bytes),
4653 perc(_total_used_bytes, _total_capacity_bytes), 4662 perc(_total_used_bytes, _total_capacity_bytes),
4654 bytes_to_mb(_total_prev_live_bytes), 4663 bytes_to_mb(_total_prev_live_bytes),
4655 perc(_total_prev_live_bytes, _total_capacity_bytes), 4664 perc(_total_prev_live_bytes, _total_capacity_bytes),
4656 bytes_to_mb(_total_next_live_bytes), 4665 bytes_to_mb(_total_next_live_bytes),
4657 perc(_total_next_live_bytes, _total_capacity_bytes)); 4666 perc(_total_next_live_bytes, _total_capacity_bytes),
4667 bytes_to_mb(_total_remset_bytes));
4658 _out->cr(); 4668 _out->cr();
4659 } 4669 }