hotspot/src/share/vm/gc/g1/g1RemSetSummary.cpp
author tschatzl
Wed, 25 Nov 2015 14:43:29 +0100
changeset 34300 6075c1e0e913
parent 34299 3fdfdda0ac1f
child 35061 be6025ebffea
permissions -rw-r--r--
8136679: JFR event for adaptive IHOP Reviewed-by: tbenson, mgerdin, sangheki, ehelin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
     1
/*
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 26846
diff changeset
     2
 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
     4
 *
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
     7
 * published by the Free Software Foundation.
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
     8
 *
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    13
 * accompanied this code).
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    14
 *
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    18
 *
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    21
 * questions.
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    22
 *
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    23
 */
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    24
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    25
#include "precompiled.hpp"
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 26846
diff changeset
    26
#include "gc/g1/concurrentG1Refine.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 26846
diff changeset
    27
#include "gc/g1/concurrentG1RefineThread.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 26846
diff changeset
    28
#include "gc/g1/g1CollectedHeap.inline.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 26846
diff changeset
    29
#include "gc/g1/g1RemSet.inline.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 26846
diff changeset
    30
#include "gc/g1/g1RemSetSummary.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 26846
diff changeset
    31
#include "gc/g1/heapRegion.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 26846
diff changeset
    32
#include "gc/g1/heapRegionRemSet.hpp"
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    33
#include "runtime/thread.inline.hpp"
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    34
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    35
class GetRSThreadVTimeClosure : public ThreadClosure {
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    36
private:
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    37
  G1RemSetSummary* _summary;
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    38
  uint _counter;
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    39
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    40
public:
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    41
  GetRSThreadVTimeClosure(G1RemSetSummary * summary) : ThreadClosure(), _summary(summary), _counter(0) {
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    42
    assert(_summary != NULL, "just checking");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    43
  }
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    44
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    45
  virtual void do_thread(Thread* t) {
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    46
    ConcurrentG1RefineThread* crt = (ConcurrentG1RefineThread*) t;
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    47
    _summary->set_rs_thread_vtime(_counter, crt->vtime_accum());
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    48
    _counter++;
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    49
  }
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    50
};
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    51
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    52
void G1RemSetSummary::update() {
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    53
  _num_refined_cards = remset()->conc_refine_cards();
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    54
  DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    55
  _num_processed_buf_mutator = dcqs.processed_buffers_mut();
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    56
  _num_processed_buf_rs_threads = dcqs.processed_buffers_rs_thread();
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    57
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    58
  _num_coarsenings = HeapRegionRemSet::n_coarsenings();
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    59
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    60
  ConcurrentG1Refine * cg1r = G1CollectedHeap::heap()->concurrent_g1_refine();
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    61
  if (_rs_threads_vtimes != NULL) {
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    62
    GetRSThreadVTimeClosure p(this);
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    63
    cg1r->worker_threads_do(&p);
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    64
  }
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    65
  set_sampling_thread_vtime(cg1r->sampling_thread()->vtime_accum());
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    66
}
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    67
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    68
void G1RemSetSummary::set_rs_thread_vtime(uint thread, double value) {
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    69
  assert(_rs_threads_vtimes != NULL, "just checking");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    70
  assert(thread < _num_vtimes, "just checking");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    71
  _rs_threads_vtimes[thread] = value;
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    72
}
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    73
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    74
double G1RemSetSummary::rs_thread_vtime(uint thread) const {
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    75
  assert(_rs_threads_vtimes != NULL, "just checking");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    76
  assert(thread < _num_vtimes, "just checking");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    77
  return _rs_threads_vtimes[thread];
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    78
}
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    79
20310
903b398490d9 8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents: 20305
diff changeset
    80
void G1RemSetSummary::initialize(G1RemSet* remset) {
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    81
  assert(_rs_threads_vtimes == NULL, "just checking");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    82
  assert(remset != NULL, "just checking");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    83
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    84
  _remset = remset;
20310
903b398490d9 8025441: G1: assert "assert(thread < _num_vtimes) failed: just checking" fails when G1ConcRefinementThreads > ParallelGCThreads
tschatzl
parents: 20305
diff changeset
    85
  _num_vtimes = ConcurrentG1Refine::thread_num();
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    86
  _rs_threads_vtimes = NEW_C_HEAP_ARRAY(double, _num_vtimes, mtGC);
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    87
  memset(_rs_threads_vtimes, 0, sizeof(double) * _num_vtimes);
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    88
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    89
  update();
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    90
}
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    91
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    92
void G1RemSetSummary::set(G1RemSetSummary* other) {
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    93
  assert(other != NULL, "just checking");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    94
  assert(remset() == other->remset(), "just checking");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    95
  assert(_num_vtimes == other->_num_vtimes, "just checking");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    96
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    97
  _num_refined_cards = other->num_concurrent_refined_cards();
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    98
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
    99
  _num_processed_buf_mutator = other->num_processed_buf_mutator();
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   100
  _num_processed_buf_rs_threads = other->num_processed_buf_rs_threads();
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   101
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   102
  _num_coarsenings = other->_num_coarsenings;
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   103
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   104
  memcpy(_rs_threads_vtimes, other->_rs_threads_vtimes, sizeof(double) * _num_vtimes);
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   105
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   106
  set_sampling_thread_vtime(other->sampling_thread_vtime());
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   107
}
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   108
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   109
void G1RemSetSummary::subtract_from(G1RemSetSummary* other) {
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   110
  assert(other != NULL, "just checking");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   111
  assert(remset() == other->remset(), "just checking");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   112
  assert(_num_vtimes == other->_num_vtimes, "just checking");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   113
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   114
  _num_refined_cards = other->num_concurrent_refined_cards() - _num_refined_cards;
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   115
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   116
  _num_processed_buf_mutator = other->num_processed_buf_mutator() - _num_processed_buf_mutator;
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   117
  _num_processed_buf_rs_threads = other->num_processed_buf_rs_threads() - _num_processed_buf_rs_threads;
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   118
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   119
  _num_coarsenings = other->num_coarsenings() - _num_coarsenings;
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   120
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   121
  for (uint i = 0; i < _num_vtimes; i++) {
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   122
    set_rs_thread_vtime(i, other->rs_thread_vtime(i) - rs_thread_vtime(i));
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   123
  }
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   124
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   125
  _sampling_thread_vtime = other->sampling_thread_vtime() - _sampling_thread_vtime;
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   126
}
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   127
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   128
static size_t round_to_K(size_t value) {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   129
  return value / K;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   130
}
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   131
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   132
class RegionTypeCounter VALUE_OBJ_CLASS_SPEC {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   133
private:
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   134
  const char* _name;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   135
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   136
  size_t _rs_mem_size;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   137
  size_t _cards_occupied;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   138
  size_t _amount;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   139
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   140
  size_t _code_root_mem_size;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   141
  size_t _code_root_elems;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   142
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   143
  double rs_mem_size_percent_of(size_t total) {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   144
    return percent_of(_rs_mem_size, total);
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   145
  }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   146
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   147
  double cards_occupied_percent_of(size_t total) {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   148
    return percent_of(_cards_occupied, total);
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   149
  }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   150
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   151
  double code_root_mem_size_percent_of(size_t total) {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   152
    return percent_of(_code_root_mem_size, total);
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   153
  }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   154
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   155
  double code_root_elems_percent_of(size_t total) {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   156
    return percent_of(_code_root_elems, total);
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   157
  }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   158
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   159
  size_t amount() const { return _amount; }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   160
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   161
public:
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   162
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   163
  RegionTypeCounter(const char* name) : _name(name), _rs_mem_size(0), _cards_occupied(0),
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   164
    _amount(0), _code_root_mem_size(0), _code_root_elems(0) { }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   165
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   166
  void add(size_t rs_mem_size, size_t cards_occupied, size_t code_root_mem_size,
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   167
    size_t code_root_elems) {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   168
    _rs_mem_size += rs_mem_size;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   169
    _cards_occupied += cards_occupied;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   170
    _code_root_mem_size += code_root_mem_size;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   171
    _code_root_elems += code_root_elems;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   172
    _amount++;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   173
  }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   174
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   175
  size_t rs_mem_size() const { return _rs_mem_size; }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   176
  size_t cards_occupied() const { return _cards_occupied; }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   177
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   178
  size_t code_root_mem_size() const { return _code_root_mem_size; }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   179
  size_t code_root_elems() const { return _code_root_elems; }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   180
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   181
  void print_rs_mem_info_on(outputStream * out, size_t total) {
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   182
    out->print_cr("    " SIZE_FORMAT_W(8) "K (%5.1f%%) by " SIZE_FORMAT " %s regions",
21117
89fa6b136f85 8026848: -XX:+G1SummarizeRSetStats can result in wrong exit code and crash
sjohanss
parents: 20310
diff changeset
   183
        round_to_K(rs_mem_size()), rs_mem_size_percent_of(total), amount(), _name);
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   184
  }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   185
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   186
  void print_cards_occupied_info_on(outputStream * out, size_t total) {
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   187
    out->print_cr("     " SIZE_FORMAT_W(8) " (%5.1f%%) entries by " SIZE_FORMAT " %s regions",
21117
89fa6b136f85 8026848: -XX:+G1SummarizeRSetStats can result in wrong exit code and crash
sjohanss
parents: 20310
diff changeset
   188
        cards_occupied(), cards_occupied_percent_of(total), amount(), _name);
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   189
  }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   190
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   191
  void print_code_root_mem_info_on(outputStream * out, size_t total) {
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   192
    out->print_cr("    " SIZE_FORMAT_W(8) "K (%5.1f%%) by " SIZE_FORMAT " %s regions",
21117
89fa6b136f85 8026848: -XX:+G1SummarizeRSetStats can result in wrong exit code and crash
sjohanss
parents: 20310
diff changeset
   193
        round_to_K(code_root_mem_size()), code_root_mem_size_percent_of(total), amount(), _name);
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   194
  }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   195
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   196
  void print_code_root_elems_info_on(outputStream * out, size_t total) {
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   197
    out->print_cr("     " SIZE_FORMAT_W(8) " (%5.1f%%) elements by " SIZE_FORMAT " %s regions",
21117
89fa6b136f85 8026848: -XX:+G1SummarizeRSetStats can result in wrong exit code and crash
sjohanss
parents: 20310
diff changeset
   198
        code_root_elems(), code_root_elems_percent_of(total), amount(), _name);
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   199
  }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   200
};
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   201
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   202
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   203
class HRRSStatsIter: public HeapRegionClosure {
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   204
private:
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   205
  RegionTypeCounter _young;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   206
  RegionTypeCounter _humonguous;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   207
  RegionTypeCounter _free;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   208
  RegionTypeCounter _old;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   209
  RegionTypeCounter _all;
19339
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   210
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   211
  size_t _max_rs_mem_sz;
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   212
  HeapRegion* _max_rs_mem_sz_region;
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   213
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   214
  size_t total_rs_mem_sz() const            { return _all.rs_mem_size(); }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   215
  size_t total_cards_occupied() const       { return _all.cards_occupied(); }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   216
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   217
  size_t max_rs_mem_sz() const              { return _max_rs_mem_sz; }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   218
  HeapRegion* max_rs_mem_sz_region() const  { return _max_rs_mem_sz_region; }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   219
19339
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   220
  size_t _max_code_root_mem_sz;
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   221
  HeapRegion* _max_code_root_mem_sz_region;
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   222
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   223
  size_t total_code_root_mem_sz() const     { return _all.code_root_mem_size(); }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   224
  size_t total_code_root_elems() const      { return _all.code_root_elems(); }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   225
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   226
  size_t max_code_root_mem_sz() const       { return _max_code_root_mem_sz; }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   227
  HeapRegion* max_code_root_mem_sz_region() const { return _max_code_root_mem_sz_region; }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   228
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   229
public:
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   230
  HRRSStatsIter() : _all("All"), _young("Young"), _humonguous("Humonguous"),
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   231
    _free("Free"), _old("Old"), _max_code_root_mem_sz_region(NULL), _max_rs_mem_sz_region(NULL),
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   232
    _max_rs_mem_sz(0), _max_code_root_mem_sz(0)
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   233
  {}
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   234
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   235
  bool doHeapRegion(HeapRegion* r) {
19339
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   236
    HeapRegionRemSet* hrrs = r->rem_set();
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   237
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   238
    // HeapRegionRemSet::mem_size() includes the
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   239
    // size of the strong code roots
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   240
    size_t rs_mem_sz = hrrs->mem_size();
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   241
    if (rs_mem_sz > _max_rs_mem_sz) {
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   242
      _max_rs_mem_sz = rs_mem_sz;
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   243
      _max_rs_mem_sz_region = r;
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   244
    }
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   245
    size_t occupied_cards = hrrs->occupied();
19339
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   246
    size_t code_root_mem_sz = hrrs->strong_code_roots_mem_size();
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   247
    if (code_root_mem_sz > max_code_root_mem_sz()) {
26422
4ee5901e205e 8048268: G1 Code Root Migration performs poorly
mgerdin
parents: 21117
diff changeset
   248
      _max_code_root_mem_sz = code_root_mem_sz;
19339
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   249
      _max_code_root_mem_sz_region = r;
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   250
    }
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   251
    size_t code_root_elems = hrrs->strong_code_roots_list_length();
19339
d247781beec7 7145569: G1: optimize nmethods scanning
johnc
parents: 17854
diff changeset
   252
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   253
    RegionTypeCounter* current = NULL;
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents: 26422
diff changeset
   254
    if (r->is_free()) {
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents: 26422
diff changeset
   255
      current = &_free;
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents: 26422
diff changeset
   256
    } else if (r->is_young()) {
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   257
      current = &_young;
26846
7d4376f8560e 8058495: G1: normalize names for isHumongous() and friends
tonyp
parents: 26696
diff changeset
   258
    } else if (r->is_humongous()) {
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   259
      current = &_humonguous;
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents: 26422
diff changeset
   260
    } else if (r->is_old()) {
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents: 26422
diff changeset
   261
      current = &_old;
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   262
    } else {
26696
623a25e6c686 8057768: Make heap region region type in G1 HeapRegion explicit
tonyp
parents: 26422
diff changeset
   263
      ShouldNotReachHere();
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   264
    }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   265
    current->add(rs_mem_sz, occupied_cards, code_root_mem_sz, code_root_elems);
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   266
    _all.add(rs_mem_sz, occupied_cards, code_root_mem_sz, code_root_elems);
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   267
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   268
    return false;
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   269
  }
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   270
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   271
  void print_summary_on(outputStream* out) {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   272
    RegionTypeCounter* counters[] = { &_young, &_humonguous, &_free, &_old, NULL };
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   273
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   274
    out->print_cr("\n Current rem set statistics");
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   275
    out->print_cr("  Total per region rem sets sizes = " SIZE_FORMAT "K."
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   276
                  " Max = " SIZE_FORMAT "K.",
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   277
                  round_to_K(total_rs_mem_sz()), round_to_K(max_rs_mem_sz()));
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   278
    for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   279
      (*current)->print_rs_mem_info_on(out, total_rs_mem_sz());
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   280
    }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   281
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   282
    out->print_cr("   Static structures = " SIZE_FORMAT "K,"
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   283
                  " free_lists = " SIZE_FORMAT "K.",
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   284
                  round_to_K(HeapRegionRemSet::static_mem_size()),
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   285
                  round_to_K(HeapRegionRemSet::fl_mem_size()));
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   286
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   287
    out->print_cr("    " SIZE_FORMAT " occupied cards represented.",
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   288
                  total_cards_occupied());
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   289
    for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   290
      (*current)->print_cards_occupied_info_on(out, total_cards_occupied());
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   291
    }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   292
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   293
    // Largest sized rem set region statistics
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   294
    HeapRegionRemSet* rem_set = max_rs_mem_sz_region()->rem_set();
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   295
    out->print_cr("    Region with largest rem set = " HR_FORMAT ", "
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   296
                  "size = " SIZE_FORMAT "K, occupied = " SIZE_FORMAT "K.",
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   297
                  HR_FORMAT_PARAMS(max_rs_mem_sz_region()),
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   298
                  round_to_K(rem_set->mem_size()),
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   299
                  round_to_K(rem_set->occupied()));
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   300
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   301
    // Strong code root statistics
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   302
    HeapRegionRemSet* max_code_root_rem_set = max_code_root_mem_sz_region()->rem_set();
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   303
    out->print_cr("  Total heap region code root sets sizes = " SIZE_FORMAT "K."
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   304
                  "  Max = " SIZE_FORMAT "K.",
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   305
                  round_to_K(total_code_root_mem_sz()),
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   306
                  round_to_K(max_code_root_rem_set->strong_code_roots_mem_size()));
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   307
    for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   308
      (*current)->print_code_root_mem_info_on(out, total_code_root_mem_sz());
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   309
    }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   310
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   311
    out->print_cr("    " SIZE_FORMAT " code roots represented.",
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   312
                  total_code_root_elems());
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   313
    for (RegionTypeCounter** current = &counters[0]; *current != NULL; current++) {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   314
      (*current)->print_code_root_elems_info_on(out, total_code_root_elems());
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   315
    }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   316
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   317
    out->print_cr("    Region with largest amount of code roots = " HR_FORMAT ", "
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   318
                  "size = " SIZE_FORMAT "K, num_elems = " SIZE_FORMAT ".",
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   319
                  HR_FORMAT_PARAMS(max_code_root_mem_sz_region()),
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   320
                  round_to_K(max_code_root_rem_set->strong_code_roots_mem_size()),
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   321
                  round_to_K(max_code_root_rem_set->strong_code_roots_list_length()));
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   322
  }
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   323
};
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   324
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   325
void G1RemSetSummary::print_on(outputStream* out) {
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   326
  out->print_cr("\n Recent concurrent refinement statistics");
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   327
  out->print_cr("  Processed " SIZE_FORMAT " cards",
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   328
                num_concurrent_refined_cards());
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   329
  out->print_cr("  Of " SIZE_FORMAT " completed buffers:", num_processed_buf_total());
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   330
  out->print_cr("     " SIZE_FORMAT_W(8) " (%5.1f%%) by concurrent RS threads.",
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   331
                num_processed_buf_total(),
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   332
                percent_of(num_processed_buf_rs_threads(), num_processed_buf_total()));
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   333
  out->print_cr("     " SIZE_FORMAT_W(8) " (%5.1f%%) by mutator threads.",
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   334
                num_processed_buf_mutator(),
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   335
                percent_of(num_processed_buf_mutator(), num_processed_buf_total()));
31592
43f48e165466 8081202: Hotspot compile warning: "Invalid suffix on literal; C++11 requires a space between literal and identifier"
bpittore
parents: 30764
diff changeset
   336
  out->print_cr("  Did " SIZE_FORMAT " coarsenings.", num_coarsenings());
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   337
  out->print_cr("  Concurrent RS threads times (s)");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   338
  out->print("     ");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   339
  for (uint i = 0; i < _num_vtimes; i++) {
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   340
    out->print("    %5.2f", rs_thread_vtime(i));
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   341
  }
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   342
  out->cr();
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   343
  out->print_cr("  Concurrent sampling threads times (s)");
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   344
  out->print_cr("         %5.2f", sampling_thread_vtime());
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   345
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   346
  HRRSStatsIter blk;
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   347
  G1CollectedHeap::heap()->heap_region_iterate(&blk);
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents: 19339
diff changeset
   348
  blk.print_summary_on(out);
17854
d65bc1546091 8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff changeset
   349
}