hotspot/src/share/vm/services/memoryManager.hpp
author ikrylov
Wed, 01 Dec 2010 18:26:32 -0500
changeset 7405 e6fc8d3926f8
parent 7397 5b173b4ca846
child 9623 151c0b638488
permissions -rw-r--r--
6348631: remove the use of the HPI library from Hotspot Summary: move functions from hpi library to hotspot, communicate with licensees and open source community, check jdk for dependency, file CCC request Reviewed-by: coleenp, acorn, dsamersoff
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6245
diff changeset
     2
 * Copyright (c) 2003, 2010, 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: 4459
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 4459
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: 4459
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: 6245
diff changeset
    25
#ifndef SHARE_VM_SERVICES_MEMORYMANAGER_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6245
diff changeset
    26
#define SHARE_VM_SERVICES_MEMORYMANAGER_HPP
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6245
diff changeset
    27
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6245
diff changeset
    28
#include "memory/allocation.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6245
diff changeset
    29
#include "runtime/timer.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6245
diff changeset
    30
#include "services/memoryUsage.hpp"
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6245
diff changeset
    31
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
// A memory manager is responsible for managing one or more memory pools.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
// The garbage collector is one type of memory managers responsible
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
// for reclaiming memory occupied by unreachable objects.  A Java virtual
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
// machine may have one or more memory managers.   It may
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
// add or remove memory managers during execution.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
// A memory pool can be managed by more than one memory managers.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
class MemoryPool;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
class GCMemoryManager;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
class OopClosure;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
class MemoryManager : public CHeapObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
  enum {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
    max_num_pools = 10
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
  MemoryPool* _pools[max_num_pools];
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
  int         _num_pools;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
protected:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
  volatile instanceOop _memory_mgr_obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
  enum Name {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
    Abstract,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
    CodeCache,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
    Copy,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
    MarkSweepCompact,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
    ParNew,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    62
    ConcurrentMarkSweep,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    63
    PSScavenge,
4459
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
    64
    PSMarkSweep,
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
    65
    G1YoungGen,
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
    66
    G1OldGen
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
  };
489c9b5090e2 Initial load
duke
parents:
diff changeset
    68
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
  MemoryManager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
  int num_memory_pools() const           { return _num_pools; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  MemoryPool* get_memory_pool(int index) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
    assert(index >= 0 && index < _num_pools, "Invalid index");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
    return _pools[index];
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
  void add_pool(MemoryPool* pool);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  bool is_manager(instanceHandle mh)     { return mh() == _memory_mgr_obj; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  virtual instanceOop get_memory_manager_instance(TRAPS);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  virtual MemoryManager::Name kind()     { return MemoryManager::Abstract; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  virtual bool is_gc_memory_manager()    { return false; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  virtual const char* name() = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
  // GC support
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
  void oops_do(OopClosure* f);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
  // Static factory methods to get a memory manager of a specific type
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
  static MemoryManager*   get_code_cache_memory_manager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  static GCMemoryManager* get_copy_memory_manager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
  static GCMemoryManager* get_msc_memory_manager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  static GCMemoryManager* get_parnew_memory_manager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  static GCMemoryManager* get_cms_memory_manager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
  static GCMemoryManager* get_psScavenge_memory_manager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  static GCMemoryManager* get_psMarkSweep_memory_manager();
4459
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
    97
  static GCMemoryManager* get_g1YoungGen_memory_manager();
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
    98
  static GCMemoryManager* get_g1OldGen_memory_manager();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
class CodeCacheMemoryManager : public MemoryManager {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
  CodeCacheMemoryManager() : MemoryManager() {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
  MemoryManager::Name kind() { return MemoryManager::CodeCache; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
  const char* name()         { return "CodeCacheManager"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
class GCStatInfo : public CHeapObj {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
  size_t _index;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
  jlong  _start_time;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
  jlong  _end_time;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
  // We keep memory usage of all memory pools
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
  MemoryUsage* _before_gc_usage_array;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
  MemoryUsage* _after_gc_usage_array;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
  int          _usage_array_size;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
  void set_gc_usage(int pool_index, MemoryUsage, bool before_gc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  GCStatInfo(int num_pools);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  ~GCStatInfo();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
  size_t gc_index()               { return _index; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  jlong  start_time()             { return _start_time; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  jlong  end_time()               { return _end_time; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
  int    usage_array_size()       { return _usage_array_size; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  MemoryUsage before_gc_usage_for_pool(int pool_index) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
    assert(pool_index >= 0 && pool_index < _usage_array_size, "Range checking");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
    return _before_gc_usage_array[pool_index];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
  MemoryUsage after_gc_usage_for_pool(int pool_index) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
    assert(pool_index >= 0 && pool_index < _usage_array_size, "Range checking");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
    return _after_gc_usage_array[pool_index];
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
6245
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 5547
diff changeset
   141
  MemoryUsage* before_gc_usage_array() { return _before_gc_usage_array; }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 5547
diff changeset
   142
  MemoryUsage* after_gc_usage_array()  { return _after_gc_usage_array; }
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 5547
diff changeset
   143
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
  void set_index(size_t index)    { _index = index; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
  void set_start_time(jlong time) { _start_time = time; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
  void set_end_time(jlong time)   { _end_time = time; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
  void set_before_gc_usage(int pool_index, MemoryUsage usage) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
    assert(pool_index >= 0 && pool_index < _usage_array_size, "Range checking");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
    set_gc_usage(pool_index, usage, true /* before gc */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
  void set_after_gc_usage(int pool_index, MemoryUsage usage) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
    assert(pool_index >= 0 && pool_index < _usage_array_size, "Range checking");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
    set_gc_usage(pool_index, usage, false /* after gc */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
6245
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 5547
diff changeset
   156
  void clear();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
class GCMemoryManager : public MemoryManager {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  // TODO: We should unify the GCCounter and GCMemoryManager statistic
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
  size_t       _num_collections;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  elapsedTimer _accumulated_timer;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  elapsedTimer _gc_timer;         // for measuring every GC duration
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  GCStatInfo*  _last_gc_stat;
6245
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 5547
diff changeset
   166
  Mutex*       _last_gc_lock;
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 5547
diff changeset
   167
  GCStatInfo*  _current_gc_stat;
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   168
  int          _num_gc_threads;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   169
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   170
  GCMemoryManager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   171
  ~GCMemoryManager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   172
489c9b5090e2 Initial load
duke
parents:
diff changeset
   173
  void   initialize_gc_stat_info();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   174
489c9b5090e2 Initial load
duke
parents:
diff changeset
   175
  bool   is_gc_memory_manager()         { return true; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   176
  jlong  gc_time_ms()                   { return _accumulated_timer.milliseconds(); }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   177
  size_t gc_count()                     { return _num_collections; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   178
  int    num_gc_threads()               { return _num_gc_threads; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   179
  void   set_num_gc_threads(int count)  { _num_gc_threads = count; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
6245
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 5547
diff changeset
   181
  void   gc_begin(bool recordGCBeginTime, bool recordPreGCUsage,
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 5547
diff changeset
   182
                  bool recordAccumulatedGCTime);
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 5547
diff changeset
   183
  void   gc_end(bool recordPostGCUsage, bool recordAccumulatedGCTime,
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 5547
diff changeset
   184
                bool recordGCEndTime, bool countCollection);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
  void        reset_gc_stat()   { _num_collections = 0; _accumulated_timer.reset(); }
6245
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 5547
diff changeset
   187
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 5547
diff changeset
   188
  // Copy out _last_gc_stat to the given destination, returning
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 5547
diff changeset
   189
  // the collection count. Zero signifies no gc has taken place.
c37d2cf6de1a 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 5547
diff changeset
   190
  size_t get_last_gc_stat(GCStatInfo* dest);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
  virtual MemoryManager::Name kind() = 0;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
// These subclasses of GCMemoryManager are defined to include
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
// GC-specific information.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
// TODO: Add GC-specific information
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
class CopyMemoryManager : public GCMemoryManager {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
  CopyMemoryManager() : GCMemoryManager() {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
  MemoryManager::Name kind() { return MemoryManager::Copy; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
  const char* name()         { return "Copy"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
class MSCMemoryManager : public GCMemoryManager {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
  MSCMemoryManager() : GCMemoryManager() {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
  MemoryManager::Name kind() { return MemoryManager::MarkSweepCompact; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  const char* name()         { return "MarkSweepCompact"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
class ParNewMemoryManager : public GCMemoryManager {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
  ParNewMemoryManager() : GCMemoryManager() {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
  MemoryManager::Name kind() { return MemoryManager::ParNew; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
  const char* name()         { return "ParNew"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
class CMSMemoryManager : public GCMemoryManager {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
  CMSMemoryManager() : GCMemoryManager() {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
  MemoryManager::Name kind() { return MemoryManager::ConcurrentMarkSweep; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
  const char* name()         { return "ConcurrentMarkSweep";}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
class PSScavengeMemoryManager : public GCMemoryManager {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
  PSScavengeMemoryManager() : GCMemoryManager() {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
  MemoryManager::Name kind() { return MemoryManager::PSScavenge; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
  const char* name()         { return "PS Scavenge"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
class PSMarkSweepMemoryManager : public GCMemoryManager {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
  PSMarkSweepMemoryManager() : GCMemoryManager() {}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
  MemoryManager::Name kind() { return MemoryManager::PSMarkSweep; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
  const char* name()         { return "PS MarkSweep"; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
};
4459
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   255
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   256
class G1YoungGenMemoryManager : public GCMemoryManager {
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   257
private:
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   258
public:
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   259
  G1YoungGenMemoryManager() : GCMemoryManager() {}
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   260
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   261
  MemoryManager::Name kind() { return MemoryManager::G1YoungGen; }
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   262
  const char* name()         { return "G1 Young Generation"; }
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   263
};
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   264
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   265
class G1OldGenMemoryManager : public GCMemoryManager {
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   266
private:
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   267
public:
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   268
  G1OldGenMemoryManager() : GCMemoryManager() {}
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   269
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   270
  MemoryManager::Name kind() { return MemoryManager::G1OldGen; }
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   271
  const char* name()         { return "G1 Old Generation"; }
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1
diff changeset
   272
};
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6245
diff changeset
   273
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 6245
diff changeset
   274
#endif // SHARE_VM_SERVICES_MEMORYMANAGER_HPP