src/hotspot/share/gc/shared/gcHeapSummary.hpp
author stefank
Fri, 24 Nov 2017 15:48:01 +0100
changeset 48116 8a5e8cd321d9
parent 47216 71c04702a3d5
child 53244 9807daeb47c4
permissions -rw-r--r--
8191861: Move and refactor hSpaceCounters Reviewed-by: pliden, ehelin, rkennke
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     1
/*
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 23853
diff changeset
     2
 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     4
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     7
 * published by the Free Software Foundation.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     8
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    13
 * accompanied this code).
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    14
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    18
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    21
 * questions.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    22
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    23
 */
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    24
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 23853
diff changeset
    25
#ifndef SHARE_VM_GC_SHARED_GCHEAPSUMMARY_HPP
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 23853
diff changeset
    26
#define SHARE_VM_GC_SHARED_GCHEAPSUMMARY_HPP
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    27
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    28
#include "memory/allocation.hpp"
23470
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
    29
#include "memory/metaspaceChunkFreeListSummary.hpp"
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    30
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    31
class VirtualSpaceSummary : public StackObj {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    32
  HeapWord* _start;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    33
  HeapWord* _committed_end;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    34
  HeapWord* _reserved_end;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    35
public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    36
  VirtualSpaceSummary() :
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    37
      _start(NULL), _committed_end(NULL), _reserved_end(NULL) { }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    38
  VirtualSpaceSummary(HeapWord* start, HeapWord* committed_end, HeapWord* reserved_end) :
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    39
      _start(start), _committed_end(committed_end), _reserved_end(reserved_end) { }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    40
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    41
  HeapWord* start() const { return _start; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    42
  HeapWord* committed_end() const { return _committed_end; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    43
  HeapWord* reserved_end() const { return _reserved_end; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    44
  size_t committed_size() const { return (uintptr_t)_committed_end - (uintptr_t)_start;  }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    45
  size_t reserved_size() const { return (uintptr_t)_reserved_end - (uintptr_t)_start; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    46
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    47
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    48
class SpaceSummary : public StackObj {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    49
  HeapWord* _start;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    50
  HeapWord* _end;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    51
  size_t    _used;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    52
public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    53
  SpaceSummary() :
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    54
      _start(NULL), _end(NULL), _used(0) { }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    55
  SpaceSummary(HeapWord* start, HeapWord* end, size_t used) :
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    56
      _start(start), _end(end), _used(used) { }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    57
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    58
  HeapWord* start() const { return _start; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    59
  HeapWord* end() const { return _end; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    60
  size_t used() const { return _used; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    61
  size_t size() const { return (uintptr_t)_end - (uintptr_t)_start; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    62
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    63
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    64
class MetaspaceSizes : public StackObj {
23853
3e1633ff6996 8035667: EventMetaspaceSummary doesn't report committed Metaspace memory
ehelin
parents: 23470
diff changeset
    65
  size_t _committed;
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    66
  size_t _used;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    67
  size_t _reserved;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    68
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    69
 public:
23853
3e1633ff6996 8035667: EventMetaspaceSummary doesn't report committed Metaspace memory
ehelin
parents: 23470
diff changeset
    70
  MetaspaceSizes() : _committed(0), _used(0), _reserved(0) {}
3e1633ff6996 8035667: EventMetaspaceSummary doesn't report committed Metaspace memory
ehelin
parents: 23470
diff changeset
    71
  MetaspaceSizes(size_t committed, size_t used, size_t reserved) :
3e1633ff6996 8035667: EventMetaspaceSummary doesn't report committed Metaspace memory
ehelin
parents: 23470
diff changeset
    72
    _committed(committed), _used(used), _reserved(reserved) {}
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    73
23853
3e1633ff6996 8035667: EventMetaspaceSummary doesn't report committed Metaspace memory
ehelin
parents: 23470
diff changeset
    74
  size_t committed() const { return _committed; }
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    75
  size_t used() const { return _used; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    76
  size_t reserved() const { return _reserved; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    77
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    78
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    79
class GCHeapSummary;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    80
class PSHeapSummary;
31344
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
    81
class G1HeapSummary;
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    82
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    83
class GCHeapSummaryVisitor {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    84
 public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    85
  virtual void visit(const GCHeapSummary* heap_summary) const = 0;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    86
  virtual void visit(const PSHeapSummary* heap_summary) const {}
31344
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
    87
  virtual void visit(const G1HeapSummary* heap_summary) const {}
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    88
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    89
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    90
class GCHeapSummary : public StackObj {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    91
  VirtualSpaceSummary _heap;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    92
  size_t _used;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    93
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    94
 public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    95
   GCHeapSummary() :
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    96
       _heap(), _used(0) { }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    97
   GCHeapSummary(VirtualSpaceSummary& heap_space, size_t used) :
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    98
       _heap(heap_space), _used(used) { }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    99
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   100
  const VirtualSpaceSummary& heap() const { return _heap; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   101
  size_t used() const { return _used; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   102
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   103
   virtual void accept(GCHeapSummaryVisitor* visitor) const {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   104
     visitor->visit(this);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   105
   }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   106
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   107
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   108
class PSHeapSummary : public GCHeapSummary {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   109
  VirtualSpaceSummary  _old;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   110
  SpaceSummary         _old_space;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   111
  VirtualSpaceSummary  _young;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   112
  SpaceSummary         _eden;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   113
  SpaceSummary         _from;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   114
  SpaceSummary         _to;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   115
 public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   116
   PSHeapSummary(VirtualSpaceSummary& heap_space, size_t heap_used, VirtualSpaceSummary old, SpaceSummary old_space, VirtualSpaceSummary young, SpaceSummary eden, SpaceSummary from, SpaceSummary to) :
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   117
       GCHeapSummary(heap_space, heap_used), _old(old), _old_space(old_space), _young(young), _eden(eden), _from(from), _to(to) { }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   118
   const VirtualSpaceSummary& old() const { return _old; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   119
   const SpaceSummary& old_space() const { return _old_space; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   120
   const VirtualSpaceSummary& young() const { return _young; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   121
   const SpaceSummary& eden() const { return _eden; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   122
   const SpaceSummary& from() const { return _from; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   123
   const SpaceSummary& to() const { return _to; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   124
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   125
   virtual void accept(GCHeapSummaryVisitor* visitor) const {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   126
     visitor->visit(this);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   127
   }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   128
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   129
31344
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
   130
class G1HeapSummary : public GCHeapSummary {
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
   131
  size_t  _edenUsed;
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
   132
  size_t  _edenCapacity;
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
   133
  size_t  _survivorUsed;
36095
2d530b26ae5c 8149648: Add number of regions to the G1HeapSummary event
david
parents: 32380
diff changeset
   134
  uint    _numberOfRegions;
31344
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
   135
 public:
36095
2d530b26ae5c 8149648: Add number of regions to the G1HeapSummary event
david
parents: 32380
diff changeset
   136
   G1HeapSummary(VirtualSpaceSummary& heap_space, size_t heap_used, size_t edenUsed, size_t edenCapacity, size_t survivorUsed, uint numberOfRegions) :
2d530b26ae5c 8149648: Add number of regions to the G1HeapSummary event
david
parents: 32380
diff changeset
   137
      GCHeapSummary(heap_space, heap_used), _edenUsed(edenUsed), _edenCapacity(edenCapacity), _survivorUsed(survivorUsed), _numberOfRegions(numberOfRegions) { }
31344
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
   138
   const size_t edenUsed() const { return _edenUsed; }
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
   139
   const size_t edenCapacity() const { return _edenCapacity; }
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
   140
   const size_t survivorUsed() const { return _survivorUsed; }
36095
2d530b26ae5c 8149648: Add number of regions to the G1HeapSummary event
david
parents: 32380
diff changeset
   141
   const uint   numberOfRegions() const { return _numberOfRegions; }
31344
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
   142
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
   143
   virtual void accept(GCHeapSummaryVisitor* visitor) const {
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
   144
     visitor->visit(this);
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
   145
   }
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
   146
};
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
   147
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   148
class MetaspaceSummary : public StackObj {
23464
ae470a2efd44 8036696: Add metaspace gc threshold to metaspace summary trace event
ehelin
parents: 18025
diff changeset
   149
  size_t _capacity_until_GC;
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   150
  MetaspaceSizes _meta_space;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   151
  MetaspaceSizes _data_space;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   152
  MetaspaceSizes _class_space;
23470
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   153
  MetaspaceChunkFreeListSummary _metaspace_chunk_free_list_summary;
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   154
  MetaspaceChunkFreeListSummary _class_chunk_free_list_summary;
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   155
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   156
 public:
23470
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   157
  MetaspaceSummary() :
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   158
    _capacity_until_GC(0),
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   159
    _meta_space(),
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   160
    _data_space(),
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   161
    _class_space(),
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   162
    _metaspace_chunk_free_list_summary(),
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   163
    _class_chunk_free_list_summary()
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   164
  {}
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   165
  MetaspaceSummary(size_t capacity_until_GC,
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   166
                   const MetaspaceSizes& meta_space,
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   167
                   const MetaspaceSizes& data_space,
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   168
                   const MetaspaceSizes& class_space,
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   169
                   const MetaspaceChunkFreeListSummary& metaspace_chunk_free_list_summary,
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   170
                   const MetaspaceChunkFreeListSummary& class_chunk_free_list_summary) :
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   171
    _capacity_until_GC(capacity_until_GC),
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   172
    _meta_space(meta_space),
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   173
    _data_space(data_space),
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   174
    _class_space(class_space),
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   175
    _metaspace_chunk_free_list_summary(metaspace_chunk_free_list_summary),
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   176
    _class_chunk_free_list_summary(class_chunk_free_list_summary)
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   177
  {}
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   178
23464
ae470a2efd44 8036696: Add metaspace gc threshold to metaspace summary trace event
ehelin
parents: 18025
diff changeset
   179
  size_t capacity_until_GC() const { return _capacity_until_GC; }
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   180
  const MetaspaceSizes& meta_space() const { return _meta_space; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   181
  const MetaspaceSizes& data_space() const { return _data_space; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   182
  const MetaspaceSizes& class_space() const { return _class_space; }
23470
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   183
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   184
  const MetaspaceChunkFreeListSummary& metaspace_chunk_free_list_summary() const {
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   185
    return _metaspace_chunk_free_list_summary;
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   186
  }
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   187
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   188
  const MetaspaceChunkFreeListSummary& class_chunk_free_list_summary() const {
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   189
    return _class_chunk_free_list_summary;
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   190
  }
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 23464
diff changeset
   191
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   192
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   193
32380
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   194
class G1EvacSummary : public StackObj {
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   195
private:
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   196
  size_t _allocated;          // Total allocated
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   197
  size_t _wasted;             // of which wasted (internal fragmentation)
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   198
  size_t _undo_wasted;        // of which wasted on undo (is not used for calculation of PLAB size)
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   199
  size_t _unused;             // Unused in last buffer
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   200
  size_t _used;
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   201
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   202
  size_t _region_end_waste; // Number of words wasted due to skipping to the next region.
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   203
  uint   _regions_filled;   // Number of regions filled completely.
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   204
  size_t _direct_allocated; // Number of words allocated directly into the regions.
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   205
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   206
  // Number of words in live objects remaining in regions that ultimately suffered an
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   207
  // evacuation failure. This is used in the regions when the regions are made old regions.
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   208
  size_t _failure_used;
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   209
  // Number of words wasted in regions which failed evacuation. This is the sum of space
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   210
  // for objects successfully copied out of the regions (now dead space) plus waste at the
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   211
  // end of regions.
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   212
  size_t _failure_waste;
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   213
public:
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   214
  G1EvacSummary(size_t allocated, size_t wasted, size_t undo_wasted, size_t unused,
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   215
    size_t used, size_t region_end_waste, uint regions_filled, size_t direct_allocated,
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   216
    size_t failure_used, size_t failure_waste) :
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   217
    _allocated(allocated), _wasted(wasted), _undo_wasted(undo_wasted), _unused(unused),
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   218
    _used(used),  _region_end_waste(region_end_waste), _regions_filled(regions_filled),
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   219
    _direct_allocated(direct_allocated), _failure_used(failure_used), _failure_waste(failure_waste)
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   220
  { }
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   221
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   222
  size_t allocated() const { return _allocated; }
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   223
  size_t wasted() const { return _wasted; }
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   224
  size_t undo_wasted() const { return _undo_wasted; }
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   225
  size_t unused() const { return _unused; }
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   226
  size_t used() const { return _used; }
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   227
  size_t region_end_waste() const { return _region_end_waste; }
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   228
  uint regions_filled() const { return _regions_filled; }
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   229
  size_t direct_allocated() const { return _direct_allocated; }
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   230
  size_t failure_used() const { return _failure_used; }
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   231
  size_t failure_waste() const { return _failure_waste; }
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   232
};
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31344
diff changeset
   233
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 23853
diff changeset
   234
#endif // SHARE_VM_GC_SHARED_GCHEAPSUMMARY_HPP