src/hotspot/share/services/memoryPool.hpp
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 32623 hotspot/src/share/vm/services/memoryPool.hpp@390a27af5657
child 48168 cb5d2d4453d0
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
32623
390a27af5657 8134626: Misc cleanups after generation array removal
jwilhelm
parents: 29690
diff changeset
     2
 * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
#ifndef SHARE_VM_SERVICES_MEMORYPOOL_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    26
#define SHARE_VM_SERVICES_MEMORYPOOL_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    28
#include "memory/heap.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    29
#include "services/memoryUsage.hpp"
15482
470d0b0c09f1 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 13728
diff changeset
    30
#include "utilities/macros.hpp"
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    31
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
// A memory pool represents the memory area that the VM manages.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// The Java virtual machine has at least one memory pool
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
// and it may create or remove memory pools during execution.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
// A memory pool can belong to the heap or the non-heap memory.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
// A Java virtual machine may also have memory pools belonging to
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
// both heap and non-heap memory.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
// Forward declaration
29690
02ce43f0f95a 8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents: 22234
diff changeset
    40
class CompactibleFreeListSpace;
02ce43f0f95a 8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents: 22234
diff changeset
    41
class ContiguousSpace;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
class MemoryManager;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
class SensorInfo;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
class Generation;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
class DefNewGeneration;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
class ThresholdSupport;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
13195
be27e1b6a4b9 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 7397
diff changeset
    48
class MemoryPool : public CHeapObj<mtInternal> {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  friend class MemoryManager;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  enum PoolType {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
    Heap    = 1,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
    NonHeap = 2
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
  enum {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
    max_num_managers = 5
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
  // We could make some of the following as performance counters
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
  // for external monitoring.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
  const char*      _name;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    64
  PoolType         _type;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    65
  size_t           _initial_size;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
  size_t           _max_size;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  bool             _available_for_allocation; // Default is true
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
  MemoryManager*   _managers[max_num_managers];
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  int              _num_managers;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  MemoryUsage      _peak_usage;               // Peak memory usage
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  MemoryUsage      _after_gc_usage;           // After GC memory usage
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  ThresholdSupport* _usage_threshold;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  ThresholdSupport* _gc_usage_threshold;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  SensorInfo*      _usage_sensor;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  SensorInfo*      _gc_usage_sensor;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  volatile instanceOop _memory_pool_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  void add_manager(MemoryManager* mgr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  MemoryPool(const char* name,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
             PoolType type,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
             size_t init_size,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
             size_t max_size,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
             bool support_usage_threshold,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
             bool support_gc_threshold);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  const char* name()                       { return _name; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  bool        is_heap()                    { return _type == Heap; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  bool        is_non_heap()                { return _type == NonHeap; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  size_t      initial_size()   const       { return _initial_size; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  int         num_memory_managers() const  { return _num_managers; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  // max size could be changed
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  virtual size_t max_size()    const       { return _max_size; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
  bool is_pool(instanceHandle pool) { return (pool() == _memory_pool_obj); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
  bool available_for_allocation()   { return _available_for_allocation; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
  bool set_available_for_allocation(bool value) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
    bool prev = _available_for_allocation;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
    _available_for_allocation = value;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
    return prev;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  MemoryManager* get_memory_manager(int index) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
    assert(index >= 0 && index < _num_managers, "Invalid index");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
    return _managers[index];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  // Records current memory usage if it's a peak usage
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  void record_peak_memory_usage();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
  MemoryUsage get_peak_memory_usage() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
    // check current memory usage first and then return peak usage
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
    record_peak_memory_usage();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
    return _peak_usage;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
  void        reset_peak_memory_usage() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
    _peak_usage = get_memory_usage();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  ThresholdSupport* usage_threshold()      { return _usage_threshold; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  ThresholdSupport* gc_usage_threshold()   { return _gc_usage_threshold; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  SensorInfo*       usage_sensor()         {  return _usage_sensor; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  SensorInfo*       gc_usage_sensor()      { return _gc_usage_sensor; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  void        set_usage_sensor_obj(instanceHandle s);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  void        set_gc_usage_sensor_obj(instanceHandle s);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  void        set_last_collection_usage(MemoryUsage u)  { _after_gc_usage = u; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  virtual instanceOop get_memory_pool_instance(TRAPS);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  virtual MemoryUsage get_memory_usage() = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
  virtual size_t      used_in_bytes() = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
  virtual bool        is_collected_pool()         { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  virtual MemoryUsage get_last_collection_usage() { return _after_gc_usage; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
  // GC support
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
  void oops_do(OopClosure* f);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
class CollectedMemoryPool : public MemoryPool {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  CollectedMemoryPool(const char* name, PoolType type, size_t init_size, size_t max_size, bool support_usage_threshold) :
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
    MemoryPool(name, type, init_size, max_size, support_usage_threshold, true) {};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  bool is_collected_pool()            { return true; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
class ContiguousSpacePool : public CollectedMemoryPool {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  ContiguousSpace* _space;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  ContiguousSpacePool(ContiguousSpace* space, const char* name, PoolType type, size_t max_size, bool support_usage_threshold);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  ContiguousSpace* space()              { return _space; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  MemoryUsage get_memory_usage();
29690
02ce43f0f95a 8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents: 22234
diff changeset
   161
  size_t used_in_bytes();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
class SurvivorContiguousSpacePool : public CollectedMemoryPool {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
private:
32623
390a27af5657 8134626: Misc cleanups after generation array removal
jwilhelm
parents: 29690
diff changeset
   166
  DefNewGeneration* _young_gen;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   167
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
public:
32623
390a27af5657 8134626: Misc cleanups after generation array removal
jwilhelm
parents: 29690
diff changeset
   169
  SurvivorContiguousSpacePool(DefNewGeneration* young_gen,
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
                              const char* name,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
                              PoolType type,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
                              size_t max_size,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
                              bool support_usage_threshold);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
  MemoryUsage get_memory_usage();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
29690
02ce43f0f95a 8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents: 22234
diff changeset
   177
  size_t used_in_bytes();
02ce43f0f95a 8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents: 22234
diff changeset
   178
  size_t committed_in_bytes();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
15482
470d0b0c09f1 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 13728
diff changeset
   181
#if INCLUDE_ALL_GCS
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
class CompactibleFreeListSpacePool : public CollectedMemoryPool {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
  CompactibleFreeListSpace* _space;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  CompactibleFreeListSpacePool(CompactibleFreeListSpace* space,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
                               const char* name,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
                               PoolType type,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
                               size_t max_size,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
                               bool support_usage_threshold);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  MemoryUsage get_memory_usage();
29690
02ce43f0f95a 8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents: 22234
diff changeset
   193
  size_t used_in_bytes();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
};
15482
470d0b0c09f1 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 13728
diff changeset
   195
#endif // INCLUDE_ALL_GCS
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
class GenerationPool : public CollectedMemoryPool {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
  Generation* _gen;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
  GenerationPool(Generation* gen, const char* name, PoolType type, bool support_usage_threshold);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  MemoryUsage get_memory_usage();
29690
02ce43f0f95a 8075416: Cleanup GC include dependencies in memoryPool.hpp
stefank
parents: 22234
diff changeset
   205
  size_t used_in_bytes();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
class CodeHeapPool: public MemoryPool {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
  CodeHeap* _codeHeap;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
  CodeHeapPool(CodeHeap* codeHeap, const char* name, bool support_usage_threshold);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  MemoryUsage get_memory_usage();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  size_t used_in_bytes()            { return _codeHeap->allocated_capacity(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   216
18444
8adb4bc92f18 8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents: 16453
diff changeset
   217
class MetaspacePool : public MemoryPool {
8adb4bc92f18 8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents: 16453
diff changeset
   218
  size_t calculate_max_size() const;
8adb4bc92f18 8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents: 16453
diff changeset
   219
 public:
8adb4bc92f18 8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents: 16453
diff changeset
   220
  MetaspacePool();
8adb4bc92f18 8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents: 16453
diff changeset
   221
  MemoryUsage get_memory_usage();
8adb4bc92f18 8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents: 16453
diff changeset
   222
  size_t used_in_bytes();
8adb4bc92f18 8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents: 16453
diff changeset
   223
};
8adb4bc92f18 8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents: 16453
diff changeset
   224
8adb4bc92f18 8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents: 16453
diff changeset
   225
class CompressedKlassSpacePool : public MemoryPool {
8adb4bc92f18 8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents: 16453
diff changeset
   226
 public:
8adb4bc92f18 8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents: 16453
diff changeset
   227
  CompressedKlassSpacePool();
8adb4bc92f18 8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents: 16453
diff changeset
   228
  MemoryUsage get_memory_usage();
8adb4bc92f18 8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents: 16453
diff changeset
   229
  size_t used_in_bytes();
8adb4bc92f18 8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents: 16453
diff changeset
   230
};
8adb4bc92f18 8013590: NPG: Add a memory pool MXBean for Metaspace
ehelin
parents: 16453
diff changeset
   231
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
   232
#endif // SHARE_VM_SERVICES_MEMORYPOOL_HPP