hotspot/src/share/vm/services/memoryService.cpp
author tonyp
Fri, 20 Nov 2009 14:47:01 -0500
changeset 4459 eb506d590394
parent 1374 4c24294029a9
child 5547 f4b087cbb361
permissions -rw-r--r--
6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC Summary: It introduces the necessary memory pools for G1. Reviewed-by: mchung, ysr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
489c9b5090e2 Initial load
duke
parents:
diff changeset
     2
 * Copyright 2003-2006 Sun Microsystems, Inc.  All Rights Reserved.
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
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    19
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    20
 * CA 95054 USA or visit www.sun.com if you need additional information or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    21
 * have any questions.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
489c9b5090e2 Initial load
duke
parents:
diff changeset
    25
# include "incls/_precompiled.incl"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
# include "incls/_memoryService.cpp.incl"
489c9b5090e2 Initial load
duke
parents:
diff changeset
    27
489c9b5090e2 Initial load
duke
parents:
diff changeset
    28
GrowableArray<MemoryPool*>* MemoryService::_pools_list =
489c9b5090e2 Initial load
duke
parents:
diff changeset
    29
  new (ResourceObj::C_HEAP) GrowableArray<MemoryPool*>(init_pools_list_size, true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    30
GrowableArray<MemoryManager*>* MemoryService::_managers_list =
489c9b5090e2 Initial load
duke
parents:
diff changeset
    31
  new (ResourceObj::C_HEAP) GrowableArray<MemoryManager*>(init_managers_list_size, true);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    32
489c9b5090e2 Initial load
duke
parents:
diff changeset
    33
GCMemoryManager* MemoryService::_minor_gc_manager = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    34
GCMemoryManager* MemoryService::_major_gc_manager = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    35
MemoryPool*      MemoryService::_code_heap_pool   = NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    36
489c9b5090e2 Initial load
duke
parents:
diff changeset
    37
class GcThreadCountClosure: public ThreadClosure {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    38
 private:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    39
  int _count;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    40
 public:
489c9b5090e2 Initial load
duke
parents:
diff changeset
    41
  GcThreadCountClosure() : _count(0) {};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    42
  void do_thread(Thread* thread);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    43
  int count() { return _count; }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    44
};
489c9b5090e2 Initial load
duke
parents:
diff changeset
    45
489c9b5090e2 Initial load
duke
parents:
diff changeset
    46
void GcThreadCountClosure::do_thread(Thread* thread) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    47
  _count++;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    48
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    49
489c9b5090e2 Initial load
duke
parents:
diff changeset
    50
void MemoryService::set_universe_heap(CollectedHeap* heap) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    51
  CollectedHeap::Name kind = heap->kind();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    52
  switch (kind) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    53
    case CollectedHeap::GenCollectedHeap : {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    54
      add_gen_collected_heap_info(GenCollectedHeap::heap());
489c9b5090e2 Initial load
duke
parents:
diff changeset
    55
      break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    56
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    57
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    58
    case CollectedHeap::ParallelScavengeHeap : {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    59
      add_parallel_scavenge_heap_info(ParallelScavengeHeap::heap());
489c9b5090e2 Initial load
duke
parents:
diff changeset
    60
      break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    61
    }
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 1
diff changeset
    62
    case CollectedHeap::G1CollectedHeap : {
4459
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
    63
      add_g1_heap_info(G1CollectedHeap::heap());
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
    64
      break;
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 1
diff changeset
    65
    }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    66
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
    67
    default: {
1374
4c24294029a9 6711316: Open source the Garbage-First garbage collector
ysr
parents: 1
diff changeset
    68
      guarantee(false, "Unrecognized kind of heap");
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    69
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    70
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    71
489c9b5090e2 Initial load
duke
parents:
diff changeset
    72
  // set the GC thread count
489c9b5090e2 Initial load
duke
parents:
diff changeset
    73
  GcThreadCountClosure gctcc;
489c9b5090e2 Initial load
duke
parents:
diff changeset
    74
  heap->gc_threads_do(&gctcc);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    75
  int count = gctcc.count();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
  if (count > 0) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    77
    _minor_gc_manager->set_num_gc_threads(count);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    78
    _major_gc_manager->set_num_gc_threads(count);
489c9b5090e2 Initial load
duke
parents:
diff changeset
    79
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
    80
489c9b5090e2 Initial load
duke
parents:
diff changeset
    81
  // All memory pools and memory managers are initialized.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    82
  //
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
  _minor_gc_manager->initialize_gc_stat_info();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    84
  _major_gc_manager->initialize_gc_stat_info();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    85
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
    86
489c9b5090e2 Initial load
duke
parents:
diff changeset
    87
// Add memory pools for GenCollectedHeap
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
// This function currently only supports two generations collected heap.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    89
// The collector for GenCollectedHeap will have two memory managers.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    90
void MemoryService::add_gen_collected_heap_info(GenCollectedHeap* heap) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
  CollectorPolicy* policy = heap->collector_policy();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    92
489c9b5090e2 Initial load
duke
parents:
diff changeset
    93
  assert(policy->is_two_generation_policy(), "Only support two generations");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    94
  guarantee(heap->n_gens() == 2, "Only support two-generation heap");
489c9b5090e2 Initial load
duke
parents:
diff changeset
    95
489c9b5090e2 Initial load
duke
parents:
diff changeset
    96
  TwoGenerationCollectorPolicy* two_gen_policy = policy->as_two_generation_policy();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    97
  if (two_gen_policy != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
    98
    GenerationSpec** specs = two_gen_policy->generations();
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
    Generation::Name kind = specs[0]->name();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   100
    switch (kind) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   101
      case Generation::DefNew:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   102
        _minor_gc_manager = MemoryManager::get_copy_memory_manager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   103
        break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   104
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   105
      case Generation::ParNew:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   106
      case Generation::ASParNew:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   107
        _minor_gc_manager = MemoryManager::get_parnew_memory_manager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   108
        break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   109
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   110
      default:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   111
        guarantee(false, "Unrecognized generation spec");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   112
        break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   113
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   114
    if (policy->is_mark_sweep_policy()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   115
      _major_gc_manager = MemoryManager::get_msc_memory_manager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   116
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   117
    } else if (policy->is_concurrent_mark_sweep_policy()) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   118
      _major_gc_manager = MemoryManager::get_cms_memory_manager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   119
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   120
    } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   121
      guarantee(false, "Unknown two-gen policy");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   122
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   123
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   124
    guarantee(false, "Non two-gen policy");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   125
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   126
  _managers_list->append(_minor_gc_manager);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   127
  _managers_list->append(_major_gc_manager);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   128
489c9b5090e2 Initial load
duke
parents:
diff changeset
   129
  add_generation_memory_pool(heap->get_gen(minor), _major_gc_manager, _minor_gc_manager);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   130
  add_generation_memory_pool(heap->get_gen(major), _major_gc_manager);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   131
489c9b5090e2 Initial load
duke
parents:
diff changeset
   132
  PermGen::Name name = policy->permanent_generation()->name();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   133
  switch (name) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   134
    case PermGen::MarkSweepCompact: {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   135
      CompactingPermGenGen* perm_gen = (CompactingPermGenGen*) heap->perm_gen();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   136
      add_compact_perm_gen_memory_pool(perm_gen, _major_gc_manager);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   137
      break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   138
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   139
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   140
    case PermGen::ConcurrentMarkSweep: {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   141
      CMSPermGenGen* cms_gen = (CMSPermGenGen*) heap->perm_gen();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   142
      add_cms_perm_gen_memory_pool(cms_gen, _major_gc_manager);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   143
      break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   144
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   145
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   146
    default:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   147
      guarantee(false, "Unrecognized perm generation");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   148
        break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   149
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   150
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   151
489c9b5090e2 Initial load
duke
parents:
diff changeset
   152
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   153
// Add memory pools for ParallelScavengeHeap
489c9b5090e2 Initial load
duke
parents:
diff changeset
   154
// This function currently only supports two generations collected heap.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   155
// The collector for ParallelScavengeHeap will have two memory managers.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   156
void MemoryService::add_parallel_scavenge_heap_info(ParallelScavengeHeap* heap) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   157
  // Two managers to keep statistics about _minor_gc_manager and _major_gc_manager GC.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   158
  _minor_gc_manager = MemoryManager::get_psScavenge_memory_manager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   159
  _major_gc_manager = MemoryManager::get_psMarkSweep_memory_manager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   160
  _managers_list->append(_minor_gc_manager);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   161
  _managers_list->append(_major_gc_manager);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   162
489c9b5090e2 Initial load
duke
parents:
diff changeset
   163
  add_psYoung_memory_pool(heap->young_gen(), _major_gc_manager, _minor_gc_manager);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   164
  add_psOld_memory_pool(heap->old_gen(), _major_gc_manager);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   165
  add_psPerm_memory_pool(heap->perm_gen(), _major_gc_manager);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   166
}
4459
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   167
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   168
void MemoryService::add_g1_heap_info(G1CollectedHeap* g1h) {
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   169
  assert(UseG1GC, "sanity");
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   170
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   171
  _minor_gc_manager = MemoryManager::get_g1YoungGen_memory_manager();
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   172
  _major_gc_manager = MemoryManager::get_g1OldGen_memory_manager();
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   173
  _managers_list->append(_minor_gc_manager);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   174
  _managers_list->append(_major_gc_manager);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   175
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   176
  add_g1YoungGen_memory_pool(g1h, _major_gc_manager, _minor_gc_manager);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   177
  add_g1OldGen_memory_pool(g1h, _major_gc_manager);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   178
  add_g1PermGen_memory_pool(g1h, _major_gc_manager);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   179
}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   180
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   181
489c9b5090e2 Initial load
duke
parents:
diff changeset
   182
MemoryPool* MemoryService::add_gen(Generation* gen,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   183
                                   const char* name,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   184
                                   bool is_heap,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   185
                                   bool support_usage_threshold) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   186
489c9b5090e2 Initial load
duke
parents:
diff changeset
   187
  MemoryPool::PoolType type = (is_heap ? MemoryPool::Heap : MemoryPool::NonHeap);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   188
  GenerationPool* pool = new GenerationPool(gen, name, type, support_usage_threshold);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   189
  _pools_list->append(pool);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   190
  return (MemoryPool*) pool;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   191
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   192
489c9b5090e2 Initial load
duke
parents:
diff changeset
   193
MemoryPool* MemoryService::add_space(ContiguousSpace* space,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   194
                                     const char* name,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   195
                                     bool is_heap,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   196
                                     size_t max_size,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   197
                                     bool support_usage_threshold) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   198
  MemoryPool::PoolType type = (is_heap ? MemoryPool::Heap : MemoryPool::NonHeap);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   199
  ContiguousSpacePool* pool = new ContiguousSpacePool(space, name, type, max_size, support_usage_threshold);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   200
489c9b5090e2 Initial load
duke
parents:
diff changeset
   201
  _pools_list->append(pool);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   202
  return (MemoryPool*) pool;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   203
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   204
489c9b5090e2 Initial load
duke
parents:
diff changeset
   205
MemoryPool* MemoryService::add_survivor_spaces(DefNewGeneration* gen,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   206
                                               const char* name,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   207
                                               bool is_heap,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   208
                                               size_t max_size,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   209
                                               bool support_usage_threshold) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   210
  MemoryPool::PoolType type = (is_heap ? MemoryPool::Heap : MemoryPool::NonHeap);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   211
  SurvivorContiguousSpacePool* pool = new SurvivorContiguousSpacePool(gen, name, type, max_size, support_usage_threshold);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   212
489c9b5090e2 Initial load
duke
parents:
diff changeset
   213
  _pools_list->append(pool);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   214
  return (MemoryPool*) pool;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   215
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   216
489c9b5090e2 Initial load
duke
parents:
diff changeset
   217
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   218
MemoryPool* MemoryService::add_cms_space(CompactibleFreeListSpace* space,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   219
                                         const char* name,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   220
                                         bool is_heap,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   221
                                         size_t max_size,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   222
                                         bool support_usage_threshold) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   223
  MemoryPool::PoolType type = (is_heap ? MemoryPool::Heap : MemoryPool::NonHeap);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   224
  CompactibleFreeListSpacePool* pool = new CompactibleFreeListSpacePool(space, name, type, max_size, support_usage_threshold);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   225
  _pools_list->append(pool);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   226
  return (MemoryPool*) pool;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   227
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   228
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   229
489c9b5090e2 Initial load
duke
parents:
diff changeset
   230
// Add memory pool(s) for one generation
489c9b5090e2 Initial load
duke
parents:
diff changeset
   231
void MemoryService::add_generation_memory_pool(Generation* gen,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   232
                                               MemoryManager* major_mgr,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   233
                                               MemoryManager* minor_mgr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   234
  Generation::Name kind = gen->kind();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   235
  int index = _pools_list->length();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   236
489c9b5090e2 Initial load
duke
parents:
diff changeset
   237
  switch (kind) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   238
    case Generation::DefNew: {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   239
      assert(major_mgr != NULL && minor_mgr != NULL, "Should have two managers");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   240
      DefNewGeneration* young_gen = (DefNewGeneration*) gen;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   241
      // Add a memory pool for each space and young gen doesn't
489c9b5090e2 Initial load
duke
parents:
diff changeset
   242
      // support low memory detection as it is expected to get filled up.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   243
      MemoryPool* eden = add_space(young_gen->eden(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   244
                                   "Eden Space",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   245
                                   true, /* is_heap */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   246
                                   young_gen->max_eden_size(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   247
                                   false /* support_usage_threshold */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   248
      MemoryPool* survivor = add_survivor_spaces(young_gen,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   249
                                                 "Survivor Space",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   250
                                                 true, /* is_heap */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   251
                                                 young_gen->max_survivor_size(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   252
                                                 false /* support_usage_threshold */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   253
      break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   254
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   255
489c9b5090e2 Initial load
duke
parents:
diff changeset
   256
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   257
    case Generation::ParNew:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   258
    case Generation::ASParNew:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   259
    {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   260
      assert(major_mgr != NULL && minor_mgr != NULL, "Should have two managers");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   261
      // Add a memory pool for each space and young gen doesn't
489c9b5090e2 Initial load
duke
parents:
diff changeset
   262
      // support low memory detection as it is expected to get filled up.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   263
      ParNewGeneration* parnew_gen = (ParNewGeneration*) gen;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   264
      MemoryPool* eden = add_space(parnew_gen->eden(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   265
                                   "Par Eden Space",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   266
                                   true /* is_heap */,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   267
                                   parnew_gen->max_eden_size(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   268
                                   false /* support_usage_threshold */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   269
      MemoryPool* survivor = add_survivor_spaces(parnew_gen,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   270
                                                 "Par Survivor Space",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   271
                                                 true, /* is_heap */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   272
                                                 parnew_gen->max_survivor_size(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   273
                                                 false /* support_usage_threshold */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   274
489c9b5090e2 Initial load
duke
parents:
diff changeset
   275
      break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   276
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   277
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   278
489c9b5090e2 Initial load
duke
parents:
diff changeset
   279
    case Generation::MarkSweepCompact: {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   280
      assert(major_mgr != NULL && minor_mgr == NULL, "Should have only one manager");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   281
      add_gen(gen,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   282
              "Tenured Gen",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   283
              true, /* is_heap */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   284
              true  /* support_usage_threshold */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   285
      break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   286
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   287
489c9b5090e2 Initial load
duke
parents:
diff changeset
   288
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   289
    case Generation::ConcurrentMarkSweep:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   290
    case Generation::ASConcurrentMarkSweep:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   291
    {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   292
      assert(major_mgr != NULL && minor_mgr == NULL, "Should have only one manager");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   293
      ConcurrentMarkSweepGeneration* cms = (ConcurrentMarkSweepGeneration*) gen;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   294
      MemoryPool* pool = add_cms_space(cms->cmsSpace(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   295
                                       "CMS Old Gen",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   296
                                       true, /* is_heap */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   297
                                       cms->reserved().byte_size(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   298
                                       true  /* support_usage_threshold */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   299
      break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   300
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   301
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   302
489c9b5090e2 Initial load
duke
parents:
diff changeset
   303
    default:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   304
      assert(false, "should not reach here");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   305
      // no memory pool added for others
489c9b5090e2 Initial load
duke
parents:
diff changeset
   306
      break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   307
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   308
489c9b5090e2 Initial load
duke
parents:
diff changeset
   309
  assert(major_mgr != NULL, "Should have at least one manager");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   310
  // Link managers and the memory pools together
489c9b5090e2 Initial load
duke
parents:
diff changeset
   311
  for (int i = index; i < _pools_list->length(); i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   312
    MemoryPool* pool = _pools_list->at(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   313
    major_mgr->add_pool(pool);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   314
    if (minor_mgr != NULL) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   315
      minor_mgr->add_pool(pool);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   316
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   317
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   318
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   319
489c9b5090e2 Initial load
duke
parents:
diff changeset
   320
void MemoryService::add_compact_perm_gen_memory_pool(CompactingPermGenGen* perm_gen,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   321
                                                     MemoryManager* mgr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   322
  PermanentGenerationSpec* spec = perm_gen->spec();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   323
  size_t max_size = spec->max_size() - spec->read_only_size() - spec->read_write_size();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   324
  MemoryPool* pool = add_space(perm_gen->unshared_space(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   325
                               "Perm Gen",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   326
                                false, /* is_heap */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   327
                                max_size,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   328
                                true   /* support_usage_threshold */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   329
  mgr->add_pool(pool);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   330
  if (UseSharedSpaces) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   331
    pool = add_space(perm_gen->ro_space(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   332
                     "Perm Gen [shared-ro]",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   333
                     false, /* is_heap */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   334
                     spec->read_only_size(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   335
                     true   /* support_usage_threshold */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   336
    mgr->add_pool(pool);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   337
489c9b5090e2 Initial load
duke
parents:
diff changeset
   338
    pool = add_space(perm_gen->rw_space(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   339
                     "Perm Gen [shared-rw]",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   340
                     false, /* is_heap */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   341
                     spec->read_write_size(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   342
                     true   /* support_usage_threshold */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   343
    mgr->add_pool(pool);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   344
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   345
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   346
489c9b5090e2 Initial load
duke
parents:
diff changeset
   347
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   348
void MemoryService::add_cms_perm_gen_memory_pool(CMSPermGenGen* cms_gen,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   349
                                                 MemoryManager* mgr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   350
489c9b5090e2 Initial load
duke
parents:
diff changeset
   351
  MemoryPool* pool = add_cms_space(cms_gen->cmsSpace(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   352
                                   "CMS Perm Gen",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   353
                                   false, /* is_heap */
489c9b5090e2 Initial load
duke
parents:
diff changeset
   354
                                   cms_gen->reserved().byte_size(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   355
                                   true   /* support_usage_threshold */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   356
  mgr->add_pool(pool);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   357
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   358
489c9b5090e2 Initial load
duke
parents:
diff changeset
   359
void MemoryService::add_psYoung_memory_pool(PSYoungGen* gen, MemoryManager* major_mgr, MemoryManager* minor_mgr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   360
  assert(major_mgr != NULL && minor_mgr != NULL, "Should have two managers");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   361
489c9b5090e2 Initial load
duke
parents:
diff changeset
   362
  // Add a memory pool for each space and young gen doesn't
489c9b5090e2 Initial load
duke
parents:
diff changeset
   363
  // support low memory detection as it is expected to get filled up.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   364
  EdenMutableSpacePool* eden = new EdenMutableSpacePool(gen,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   365
                                                        gen->eden_space(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   366
                                                        "PS Eden Space",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   367
                                                        MemoryPool::Heap,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   368
                                                        false /* support_usage_threshold */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   369
489c9b5090e2 Initial load
duke
parents:
diff changeset
   370
  SurvivorMutableSpacePool* survivor = new SurvivorMutableSpacePool(gen,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   371
                                                                    "PS Survivor Space",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   372
                                                                    MemoryPool::Heap,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   373
                                                                    false /* support_usage_threshold */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   374
489c9b5090e2 Initial load
duke
parents:
diff changeset
   375
  major_mgr->add_pool(eden);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   376
  major_mgr->add_pool(survivor);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   377
  minor_mgr->add_pool(eden);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   378
  minor_mgr->add_pool(survivor);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   379
  _pools_list->append(eden);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   380
  _pools_list->append(survivor);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   381
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   382
489c9b5090e2 Initial load
duke
parents:
diff changeset
   383
void MemoryService::add_psOld_memory_pool(PSOldGen* gen, MemoryManager* mgr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   384
  PSGenerationPool* old_gen = new PSGenerationPool(gen,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   385
                                                   "PS Old Gen",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   386
                                                   MemoryPool::Heap,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   387
                                                   true /* support_usage_threshold */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   388
  mgr->add_pool(old_gen);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   389
  _pools_list->append(old_gen);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   390
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   391
489c9b5090e2 Initial load
duke
parents:
diff changeset
   392
void MemoryService::add_psPerm_memory_pool(PSPermGen* gen, MemoryManager* mgr) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   393
  PSGenerationPool* perm_gen = new PSGenerationPool(gen,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   394
                                                    "PS Perm Gen",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   395
                                                    MemoryPool::NonHeap,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   396
                                                    true /* support_usage_threshold */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   397
  mgr->add_pool(perm_gen);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   398
  _pools_list->append(perm_gen);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   399
}
4459
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   400
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   401
void MemoryService::add_g1YoungGen_memory_pool(G1CollectedHeap* g1h,
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   402
                                               MemoryManager* major_mgr,
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   403
                                               MemoryManager* minor_mgr) {
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   404
  assert(major_mgr != NULL && minor_mgr != NULL, "should have two managers");
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   405
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   406
  G1EdenPool* eden = new G1EdenPool(g1h);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   407
  G1SurvivorPool* survivor = new G1SurvivorPool(g1h);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   408
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   409
  major_mgr->add_pool(eden);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   410
  major_mgr->add_pool(survivor);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   411
  minor_mgr->add_pool(eden);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   412
  minor_mgr->add_pool(survivor);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   413
  _pools_list->append(eden);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   414
  _pools_list->append(survivor);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   415
}
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   416
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   417
void MemoryService::add_g1OldGen_memory_pool(G1CollectedHeap* g1h,
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   418
                                             MemoryManager* mgr) {
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   419
  assert(mgr != NULL, "should have one manager");
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   420
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   421
  G1OldGenPool* old_gen = new G1OldGenPool(g1h);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   422
  mgr->add_pool(old_gen);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   423
  _pools_list->append(old_gen);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   424
}
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   425
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   426
void MemoryService::add_g1PermGen_memory_pool(G1CollectedHeap* g1h,
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   427
                                              MemoryManager* mgr) {
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   428
  assert(mgr != NULL, "should have one manager");
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   429
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   430
  CompactingPermGenGen* perm_gen = (CompactingPermGenGen*) g1h->perm_gen();
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   431
  PermanentGenerationSpec* spec = perm_gen->spec();
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   432
  size_t max_size = spec->max_size() - spec->read_only_size()
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   433
                                     - spec->read_write_size();
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   434
  MemoryPool* pool = add_space(perm_gen->unshared_space(),
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   435
                               "G1 Perm Gen",
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   436
                               false, /* is_heap */
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   437
                               max_size,
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   438
                               true   /* support_usage_threshold */);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   439
  mgr->add_pool(pool);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   440
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   441
  // in case we support CDS in G1
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   442
  if (UseSharedSpaces) {
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   443
    pool = add_space(perm_gen->ro_space(),
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   444
                     "G1 Perm Gen [shared-ro]",
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   445
                     false, /* is_heap */
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   446
                     spec->read_only_size(),
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   447
                     true   /* support_usage_threshold */);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   448
    mgr->add_pool(pool);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   449
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   450
    pool = add_space(perm_gen->rw_space(),
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   451
                     "G1 Perm Gen [shared-rw]",
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   452
                     false, /* is_heap */
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   453
                     spec->read_write_size(),
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   454
                     true   /* support_usage_threshold */);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   455
    mgr->add_pool(pool);
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   456
  }
eb506d590394 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 1374
diff changeset
   457
}
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   458
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   459
489c9b5090e2 Initial load
duke
parents:
diff changeset
   460
void MemoryService::add_code_heap_memory_pool(CodeHeap* heap) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   461
  _code_heap_pool = new CodeHeapPool(heap,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   462
                                     "Code Cache",
489c9b5090e2 Initial load
duke
parents:
diff changeset
   463
                                     true /* support_usage_threshold */);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   464
  MemoryManager* mgr = MemoryManager::get_code_cache_memory_manager();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   465
  mgr->add_pool(_code_heap_pool);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   466
489c9b5090e2 Initial load
duke
parents:
diff changeset
   467
  _pools_list->append(_code_heap_pool);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   468
  _managers_list->append(mgr);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   469
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   470
489c9b5090e2 Initial load
duke
parents:
diff changeset
   471
MemoryManager* MemoryService::get_memory_manager(instanceHandle mh) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   472
  for (int i = 0; i < _managers_list->length(); i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   473
    MemoryManager* mgr = _managers_list->at(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   474
    if (mgr->is_manager(mh)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   475
      return mgr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   476
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   477
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   478
  return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   479
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   480
489c9b5090e2 Initial load
duke
parents:
diff changeset
   481
MemoryPool* MemoryService::get_memory_pool(instanceHandle ph) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   482
  for (int i = 0; i < _pools_list->length(); i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   483
    MemoryPool* pool = _pools_list->at(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   484
    if (pool->is_pool(ph)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   485
      return pool;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   486
    }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   487
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   488
  return NULL;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   489
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   490
489c9b5090e2 Initial load
duke
parents:
diff changeset
   491
void MemoryService::track_memory_usage() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   492
  // Track the peak memory usage
489c9b5090e2 Initial load
duke
parents:
diff changeset
   493
  for (int i = 0; i < _pools_list->length(); i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   494
    MemoryPool* pool = _pools_list->at(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   495
    pool->record_peak_memory_usage();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   496
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   497
489c9b5090e2 Initial load
duke
parents:
diff changeset
   498
  // Detect low memory
489c9b5090e2 Initial load
duke
parents:
diff changeset
   499
  LowMemoryDetector::detect_low_memory();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   500
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   501
489c9b5090e2 Initial load
duke
parents:
diff changeset
   502
void MemoryService::track_memory_pool_usage(MemoryPool* pool) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   503
  // Track the peak memory usage
489c9b5090e2 Initial load
duke
parents:
diff changeset
   504
  pool->record_peak_memory_usage();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   505
489c9b5090e2 Initial load
duke
parents:
diff changeset
   506
  // Detect low memory
489c9b5090e2 Initial load
duke
parents:
diff changeset
   507
  if (LowMemoryDetector::is_enabled(pool)) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   508
    LowMemoryDetector::detect_low_memory(pool);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   509
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   510
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   511
489c9b5090e2 Initial load
duke
parents:
diff changeset
   512
void MemoryService::gc_begin(bool fullGC) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   513
  GCMemoryManager* mgr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   514
  if (fullGC) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   515
    mgr = _major_gc_manager;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   516
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   517
    mgr = _minor_gc_manager;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   518
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   519
  assert(mgr->is_gc_memory_manager(), "Sanity check");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   520
  mgr->gc_begin();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   521
489c9b5090e2 Initial load
duke
parents:
diff changeset
   522
  // Track the peak memory usage when GC begins
489c9b5090e2 Initial load
duke
parents:
diff changeset
   523
  for (int i = 0; i < _pools_list->length(); i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   524
    MemoryPool* pool = _pools_list->at(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   525
    pool->record_peak_memory_usage();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   526
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   527
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   528
489c9b5090e2 Initial load
duke
parents:
diff changeset
   529
void MemoryService::gc_end(bool fullGC) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   530
  GCMemoryManager* mgr;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   531
  if (fullGC) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   532
    mgr = (GCMemoryManager*) _major_gc_manager;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   533
  } else {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   534
    mgr = (GCMemoryManager*) _minor_gc_manager;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   535
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   536
  assert(mgr->is_gc_memory_manager(), "Sanity check");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   537
489c9b5090e2 Initial load
duke
parents:
diff changeset
   538
  // register the GC end statistics and memory usage
489c9b5090e2 Initial load
duke
parents:
diff changeset
   539
  mgr->gc_end();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   540
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   541
489c9b5090e2 Initial load
duke
parents:
diff changeset
   542
void MemoryService::oops_do(OopClosure* f) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   543
  int i;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   544
489c9b5090e2 Initial load
duke
parents:
diff changeset
   545
  for (i = 0; i < _pools_list->length(); i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   546
    MemoryPool* pool = _pools_list->at(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   547
    pool->oops_do(f);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   548
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   549
  for (i = 0; i < _managers_list->length(); i++) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   550
    MemoryManager* mgr = _managers_list->at(i);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   551
    mgr->oops_do(f);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   552
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   553
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   554
489c9b5090e2 Initial load
duke
parents:
diff changeset
   555
bool MemoryService::set_verbose(bool verbose) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   556
  MutexLocker m(Management_lock);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   557
  // verbose will be set to the previous value
489c9b5090e2 Initial load
duke
parents:
diff changeset
   558
  bool succeed = CommandLineFlags::boolAtPut((char*)"PrintGC", &verbose, MANAGEMENT);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   559
  assert(succeed, "Setting PrintGC flag fails");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   560
  ClassLoadingService::reset_trace_class_unloading();
489c9b5090e2 Initial load
duke
parents:
diff changeset
   561
489c9b5090e2 Initial load
duke
parents:
diff changeset
   562
  return verbose;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   563
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   564
489c9b5090e2 Initial load
duke
parents:
diff changeset
   565
Handle MemoryService::create_MemoryUsage_obj(MemoryUsage usage, TRAPS) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   566
  klassOop k = Management::java_lang_management_MemoryUsage_klass(CHECK_NH);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   567
  instanceKlassHandle ik(THREAD, k);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   568
489c9b5090e2 Initial load
duke
parents:
diff changeset
   569
  instanceHandle obj = ik->allocate_instance_handle(CHECK_NH);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   570
489c9b5090e2 Initial load
duke
parents:
diff changeset
   571
  JavaValue result(T_VOID);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   572
  JavaCallArguments args(10);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   573
  args.push_oop(obj);                         // receiver
489c9b5090e2 Initial load
duke
parents:
diff changeset
   574
  args.push_long(usage.init_size_as_jlong()); // Argument 1
489c9b5090e2 Initial load
duke
parents:
diff changeset
   575
  args.push_long(usage.used_as_jlong());      // Argument 2
489c9b5090e2 Initial load
duke
parents:
diff changeset
   576
  args.push_long(usage.committed_as_jlong()); // Argument 3
489c9b5090e2 Initial load
duke
parents:
diff changeset
   577
  args.push_long(usage.max_size_as_jlong());  // Argument 4
489c9b5090e2 Initial load
duke
parents:
diff changeset
   578
489c9b5090e2 Initial load
duke
parents:
diff changeset
   579
  JavaCalls::call_special(&result,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   580
                          ik,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   581
                          vmSymbolHandles::object_initializer_name(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   582
                          vmSymbolHandles::long_long_long_long_void_signature(),
489c9b5090e2 Initial load
duke
parents:
diff changeset
   583
                          &args,
489c9b5090e2 Initial load
duke
parents:
diff changeset
   584
                          CHECK_NH);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   585
  return obj;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   586
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   587
//
489c9b5090e2 Initial load
duke
parents:
diff changeset
   588
// GC manager type depends on the type of Generation. Depending the space
489c9b5090e2 Initial load
duke
parents:
diff changeset
   589
// availablity and vm option the gc uses major gc manager or minor gc
489c9b5090e2 Initial load
duke
parents:
diff changeset
   590
// manager or both. The type of gc manager depends on the generation kind.
489c9b5090e2 Initial load
duke
parents:
diff changeset
   591
// For DefNew, ParNew and ASParNew generation doing scavange gc uses minor
489c9b5090e2 Initial load
duke
parents:
diff changeset
   592
// gc manager (so _fullGC is set to false ) and for other generation kind
489c9b5090e2 Initial load
duke
parents:
diff changeset
   593
// DOing mark-sweep-compact uses major gc manager (so _fullGC is set
489c9b5090e2 Initial load
duke
parents:
diff changeset
   594
// to true).
489c9b5090e2 Initial load
duke
parents:
diff changeset
   595
TraceMemoryManagerStats::TraceMemoryManagerStats(Generation::Name kind) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   596
  switch (kind) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   597
    case Generation::DefNew:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   598
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   599
    case Generation::ParNew:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   600
    case Generation::ASParNew:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   601
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   602
      _fullGC=false;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   603
      break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   604
    case Generation::MarkSweepCompact:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   605
#ifndef SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   606
    case Generation::ConcurrentMarkSweep:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   607
    case Generation::ASConcurrentMarkSweep:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   608
#endif // SERIALGC
489c9b5090e2 Initial load
duke
parents:
diff changeset
   609
      _fullGC=true;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   610
      break;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   611
    default:
489c9b5090e2 Initial load
duke
parents:
diff changeset
   612
      assert(false, "Unrecognized gc generation kind.");
489c9b5090e2 Initial load
duke
parents:
diff changeset
   613
  }
489c9b5090e2 Initial load
duke
parents:
diff changeset
   614
  MemoryService::gc_begin(_fullGC);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   615
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   616
TraceMemoryManagerStats::TraceMemoryManagerStats(bool fullGC) {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   617
  _fullGC = fullGC;
489c9b5090e2 Initial load
duke
parents:
diff changeset
   618
  MemoryService::gc_begin(_fullGC);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   619
}
489c9b5090e2 Initial load
duke
parents:
diff changeset
   620
489c9b5090e2 Initial load
duke
parents:
diff changeset
   621
TraceMemoryManagerStats::~TraceMemoryManagerStats() {
489c9b5090e2 Initial load
duke
parents:
diff changeset
   622
  MemoryService::gc_end(_fullGC);
489c9b5090e2 Initial load
duke
parents:
diff changeset
   623
}