annotate src/share/vm/services/memoryService.cpp @ 8761:8b4ce9870fd6

8009156: [parfait] Null pointer deference in hotspot/src/share/vm/services/memoryService.cpp Summary: add guarantee() to add_generation_memory_pool() Reviewed-by: kvn, twisti
author morris
date Sat, 16 Mar 2013 07:39:57 -0700
parents db9981fd3124
children 338b3a9e29b5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6197
diff changeset
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1089
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1089
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1089
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
26 #include "classfile/systemDictionary.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
27 #include "classfile/vmSymbols.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
28 #include "gc_implementation/shared/mutableSpace.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
29 #include "memory/collectorPolicy.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
30 #include "memory/defNewGeneration.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
31 #include "memory/genCollectedHeap.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
32 #include "memory/generation.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
33 #include "memory/generationSpec.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
34 #include "memory/heap.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
35 #include "memory/memRegion.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
36 #include "memory/tenuredGeneration.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
37 #include "oops/oop.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
38 #include "runtime/javaCalls.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
39 #include "services/classLoadingService.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
40 #include "services/lowMemoryDetector.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
41 #include "services/management.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
42 #include "services/memoryManager.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
43 #include "services/memoryPool.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
44 #include "services/memoryService.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
45 #include "utilities/growableArray.hpp"
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
46 #include "utilities/macros.hpp"
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
47 #if INCLUDE_ALL_GCS
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
48 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
49 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
50 #include "gc_implementation/parNew/parNewGeneration.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
51 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
52 #include "gc_implementation/parallelScavenge/psOldGen.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
53 #include "gc_implementation/parallelScavenge/psYoungGen.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
54 #include "services/g1MemoryPool.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1703
diff changeset
55 #include "services/psMemoryPool.hpp"
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
56 #endif // INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 GrowableArray<MemoryPool*>* MemoryService::_pools_list =
6197
d2a62e0f25eb 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 3356
diff changeset
59 new (ResourceObj::C_HEAP, mtInternal) GrowableArray<MemoryPool*>(init_pools_list_size, true);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
60 GrowableArray<MemoryManager*>* MemoryService::_managers_list =
6197
d2a62e0f25eb 6995781: Native Memory Tracking (Phase 1)
zgu
parents: 3356
diff changeset
61 new (ResourceObj::C_HEAP, mtInternal) GrowableArray<MemoryManager*>(init_managers_list_size, true);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
62
a61af66fc99e Initial load
duke
parents:
diff changeset
63 GCMemoryManager* MemoryService::_minor_gc_manager = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
64 GCMemoryManager* MemoryService::_major_gc_manager = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 MemoryPool* MemoryService::_code_heap_pool = NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
66
a61af66fc99e Initial load
duke
parents:
diff changeset
67 class GcThreadCountClosure: public ThreadClosure {
a61af66fc99e Initial load
duke
parents:
diff changeset
68 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
69 int _count;
a61af66fc99e Initial load
duke
parents:
diff changeset
70 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
71 GcThreadCountClosure() : _count(0) {};
a61af66fc99e Initial load
duke
parents:
diff changeset
72 void do_thread(Thread* thread);
a61af66fc99e Initial load
duke
parents:
diff changeset
73 int count() { return _count; }
a61af66fc99e Initial load
duke
parents:
diff changeset
74 };
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 void GcThreadCountClosure::do_thread(Thread* thread) {
a61af66fc99e Initial load
duke
parents:
diff changeset
77 _count++;
a61af66fc99e Initial load
duke
parents:
diff changeset
78 }
a61af66fc99e Initial load
duke
parents:
diff changeset
79
a61af66fc99e Initial load
duke
parents:
diff changeset
80 void MemoryService::set_universe_heap(CollectedHeap* heap) {
a61af66fc99e Initial load
duke
parents:
diff changeset
81 CollectedHeap::Name kind = heap->kind();
a61af66fc99e Initial load
duke
parents:
diff changeset
82 switch (kind) {
a61af66fc99e Initial load
duke
parents:
diff changeset
83 case CollectedHeap::GenCollectedHeap : {
a61af66fc99e Initial load
duke
parents:
diff changeset
84 add_gen_collected_heap_info(GenCollectedHeap::heap());
a61af66fc99e Initial load
duke
parents:
diff changeset
85 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
86 }
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
87 #if INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
88 case CollectedHeap::ParallelScavengeHeap : {
a61af66fc99e Initial load
duke
parents:
diff changeset
89 add_parallel_scavenge_heap_info(ParallelScavengeHeap::heap());
a61af66fc99e Initial load
duke
parents:
diff changeset
90 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
91 }
342
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
92 case CollectedHeap::G1CollectedHeap : {
1089
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
93 add_g1_heap_info(G1CollectedHeap::heap());
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
94 break;
342
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
95 }
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
96 #endif // INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
97 default: {
342
37f87013dfd8 6711316: Open source the Garbage-First garbage collector
ysr
parents: 0
diff changeset
98 guarantee(false, "Unrecognized kind of heap");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
99 }
a61af66fc99e Initial load
duke
parents:
diff changeset
100 }
a61af66fc99e Initial load
duke
parents:
diff changeset
101
a61af66fc99e Initial load
duke
parents:
diff changeset
102 // set the GC thread count
a61af66fc99e Initial load
duke
parents:
diff changeset
103 GcThreadCountClosure gctcc;
a61af66fc99e Initial load
duke
parents:
diff changeset
104 heap->gc_threads_do(&gctcc);
a61af66fc99e Initial load
duke
parents:
diff changeset
105 int count = gctcc.count();
a61af66fc99e Initial load
duke
parents:
diff changeset
106 if (count > 0) {
a61af66fc99e Initial load
duke
parents:
diff changeset
107 _minor_gc_manager->set_num_gc_threads(count);
a61af66fc99e Initial load
duke
parents:
diff changeset
108 _major_gc_manager->set_num_gc_threads(count);
a61af66fc99e Initial load
duke
parents:
diff changeset
109 }
a61af66fc99e Initial load
duke
parents:
diff changeset
110
a61af66fc99e Initial load
duke
parents:
diff changeset
111 // All memory pools and memory managers are initialized.
a61af66fc99e Initial load
duke
parents:
diff changeset
112 //
a61af66fc99e Initial load
duke
parents:
diff changeset
113 _minor_gc_manager->initialize_gc_stat_info();
a61af66fc99e Initial load
duke
parents:
diff changeset
114 _major_gc_manager->initialize_gc_stat_info();
a61af66fc99e Initial load
duke
parents:
diff changeset
115 }
a61af66fc99e Initial load
duke
parents:
diff changeset
116
a61af66fc99e Initial load
duke
parents:
diff changeset
117 // Add memory pools for GenCollectedHeap
a61af66fc99e Initial load
duke
parents:
diff changeset
118 // This function currently only supports two generations collected heap.
a61af66fc99e Initial load
duke
parents:
diff changeset
119 // The collector for GenCollectedHeap will have two memory managers.
a61af66fc99e Initial load
duke
parents:
diff changeset
120 void MemoryService::add_gen_collected_heap_info(GenCollectedHeap* heap) {
a61af66fc99e Initial load
duke
parents:
diff changeset
121 CollectorPolicy* policy = heap->collector_policy();
a61af66fc99e Initial load
duke
parents:
diff changeset
122
a61af66fc99e Initial load
duke
parents:
diff changeset
123 assert(policy->is_two_generation_policy(), "Only support two generations");
a61af66fc99e Initial load
duke
parents:
diff changeset
124 guarantee(heap->n_gens() == 2, "Only support two-generation heap");
a61af66fc99e Initial load
duke
parents:
diff changeset
125
a61af66fc99e Initial load
duke
parents:
diff changeset
126 TwoGenerationCollectorPolicy* two_gen_policy = policy->as_two_generation_policy();
a61af66fc99e Initial load
duke
parents:
diff changeset
127 if (two_gen_policy != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
128 GenerationSpec** specs = two_gen_policy->generations();
a61af66fc99e Initial load
duke
parents:
diff changeset
129 Generation::Name kind = specs[0]->name();
a61af66fc99e Initial load
duke
parents:
diff changeset
130 switch (kind) {
a61af66fc99e Initial load
duke
parents:
diff changeset
131 case Generation::DefNew:
a61af66fc99e Initial load
duke
parents:
diff changeset
132 _minor_gc_manager = MemoryManager::get_copy_memory_manager();
a61af66fc99e Initial load
duke
parents:
diff changeset
133 break;
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
134 #if INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
135 case Generation::ParNew:
a61af66fc99e Initial load
duke
parents:
diff changeset
136 case Generation::ASParNew:
a61af66fc99e Initial load
duke
parents:
diff changeset
137 _minor_gc_manager = MemoryManager::get_parnew_memory_manager();
a61af66fc99e Initial load
duke
parents:
diff changeset
138 break;
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
139 #endif // INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
140 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
141 guarantee(false, "Unrecognized generation spec");
a61af66fc99e Initial load
duke
parents:
diff changeset
142 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
143 }
a61af66fc99e Initial load
duke
parents:
diff changeset
144 if (policy->is_mark_sweep_policy()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
145 _major_gc_manager = MemoryManager::get_msc_memory_manager();
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
146 #if INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
147 } else if (policy->is_concurrent_mark_sweep_policy()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
148 _major_gc_manager = MemoryManager::get_cms_memory_manager();
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
149 #endif // INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
150 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
151 guarantee(false, "Unknown two-gen policy");
a61af66fc99e Initial load
duke
parents:
diff changeset
152 }
a61af66fc99e Initial load
duke
parents:
diff changeset
153 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
154 guarantee(false, "Non two-gen policy");
a61af66fc99e Initial load
duke
parents:
diff changeset
155 }
a61af66fc99e Initial load
duke
parents:
diff changeset
156 _managers_list->append(_minor_gc_manager);
a61af66fc99e Initial load
duke
parents:
diff changeset
157 _managers_list->append(_major_gc_manager);
a61af66fc99e Initial load
duke
parents:
diff changeset
158
a61af66fc99e Initial load
duke
parents:
diff changeset
159 add_generation_memory_pool(heap->get_gen(minor), _major_gc_manager, _minor_gc_manager);
a61af66fc99e Initial load
duke
parents:
diff changeset
160 add_generation_memory_pool(heap->get_gen(major), _major_gc_manager);
a61af66fc99e Initial load
duke
parents:
diff changeset
161 }
a61af66fc99e Initial load
duke
parents:
diff changeset
162
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
163 #if INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
164 // Add memory pools for ParallelScavengeHeap
a61af66fc99e Initial load
duke
parents:
diff changeset
165 // This function currently only supports two generations collected heap.
a61af66fc99e Initial load
duke
parents:
diff changeset
166 // The collector for ParallelScavengeHeap will have two memory managers.
a61af66fc99e Initial load
duke
parents:
diff changeset
167 void MemoryService::add_parallel_scavenge_heap_info(ParallelScavengeHeap* heap) {
a61af66fc99e Initial load
duke
parents:
diff changeset
168 // Two managers to keep statistics about _minor_gc_manager and _major_gc_manager GC.
a61af66fc99e Initial load
duke
parents:
diff changeset
169 _minor_gc_manager = MemoryManager::get_psScavenge_memory_manager();
a61af66fc99e Initial load
duke
parents:
diff changeset
170 _major_gc_manager = MemoryManager::get_psMarkSweep_memory_manager();
a61af66fc99e Initial load
duke
parents:
diff changeset
171 _managers_list->append(_minor_gc_manager);
a61af66fc99e Initial load
duke
parents:
diff changeset
172 _managers_list->append(_major_gc_manager);
a61af66fc99e Initial load
duke
parents:
diff changeset
173
a61af66fc99e Initial load
duke
parents:
diff changeset
174 add_psYoung_memory_pool(heap->young_gen(), _major_gc_manager, _minor_gc_manager);
a61af66fc99e Initial load
duke
parents:
diff changeset
175 add_psOld_memory_pool(heap->old_gen(), _major_gc_manager);
a61af66fc99e Initial load
duke
parents:
diff changeset
176 }
1089
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
177
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
178 void MemoryService::add_g1_heap_info(G1CollectedHeap* g1h) {
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
179 assert(UseG1GC, "sanity");
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
180
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
181 _minor_gc_manager = MemoryManager::get_g1YoungGen_memory_manager();
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
182 _major_gc_manager = MemoryManager::get_g1OldGen_memory_manager();
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
183 _managers_list->append(_minor_gc_manager);
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
184 _managers_list->append(_major_gc_manager);
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
185
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
186 add_g1YoungGen_memory_pool(g1h, _major_gc_manager, _minor_gc_manager);
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
187 add_g1OldGen_memory_pool(g1h, _major_gc_manager);
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
188 }
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
189 #endif // INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
190
a61af66fc99e Initial load
duke
parents:
diff changeset
191 MemoryPool* MemoryService::add_gen(Generation* gen,
a61af66fc99e Initial load
duke
parents:
diff changeset
192 const char* name,
a61af66fc99e Initial load
duke
parents:
diff changeset
193 bool is_heap,
a61af66fc99e Initial load
duke
parents:
diff changeset
194 bool support_usage_threshold) {
a61af66fc99e Initial load
duke
parents:
diff changeset
195
a61af66fc99e Initial load
duke
parents:
diff changeset
196 MemoryPool::PoolType type = (is_heap ? MemoryPool::Heap : MemoryPool::NonHeap);
a61af66fc99e Initial load
duke
parents:
diff changeset
197 GenerationPool* pool = new GenerationPool(gen, name, type, support_usage_threshold);
a61af66fc99e Initial load
duke
parents:
diff changeset
198 _pools_list->append(pool);
a61af66fc99e Initial load
duke
parents:
diff changeset
199 return (MemoryPool*) pool;
a61af66fc99e Initial load
duke
parents:
diff changeset
200 }
a61af66fc99e Initial load
duke
parents:
diff changeset
201
a61af66fc99e Initial load
duke
parents:
diff changeset
202 MemoryPool* MemoryService::add_space(ContiguousSpace* space,
a61af66fc99e Initial load
duke
parents:
diff changeset
203 const char* name,
a61af66fc99e Initial load
duke
parents:
diff changeset
204 bool is_heap,
a61af66fc99e Initial load
duke
parents:
diff changeset
205 size_t max_size,
a61af66fc99e Initial load
duke
parents:
diff changeset
206 bool support_usage_threshold) {
a61af66fc99e Initial load
duke
parents:
diff changeset
207 MemoryPool::PoolType type = (is_heap ? MemoryPool::Heap : MemoryPool::NonHeap);
a61af66fc99e Initial load
duke
parents:
diff changeset
208 ContiguousSpacePool* pool = new ContiguousSpacePool(space, name, type, max_size, support_usage_threshold);
a61af66fc99e Initial load
duke
parents:
diff changeset
209
a61af66fc99e Initial load
duke
parents:
diff changeset
210 _pools_list->append(pool);
a61af66fc99e Initial load
duke
parents:
diff changeset
211 return (MemoryPool*) pool;
a61af66fc99e Initial load
duke
parents:
diff changeset
212 }
a61af66fc99e Initial load
duke
parents:
diff changeset
213
a61af66fc99e Initial load
duke
parents:
diff changeset
214 MemoryPool* MemoryService::add_survivor_spaces(DefNewGeneration* gen,
a61af66fc99e Initial load
duke
parents:
diff changeset
215 const char* name,
a61af66fc99e Initial load
duke
parents:
diff changeset
216 bool is_heap,
a61af66fc99e Initial load
duke
parents:
diff changeset
217 size_t max_size,
a61af66fc99e Initial load
duke
parents:
diff changeset
218 bool support_usage_threshold) {
a61af66fc99e Initial load
duke
parents:
diff changeset
219 MemoryPool::PoolType type = (is_heap ? MemoryPool::Heap : MemoryPool::NonHeap);
a61af66fc99e Initial load
duke
parents:
diff changeset
220 SurvivorContiguousSpacePool* pool = new SurvivorContiguousSpacePool(gen, name, type, max_size, support_usage_threshold);
a61af66fc99e Initial load
duke
parents:
diff changeset
221
a61af66fc99e Initial load
duke
parents:
diff changeset
222 _pools_list->append(pool);
a61af66fc99e Initial load
duke
parents:
diff changeset
223 return (MemoryPool*) pool;
a61af66fc99e Initial load
duke
parents:
diff changeset
224 }
a61af66fc99e Initial load
duke
parents:
diff changeset
225
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
226 #if INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
227 MemoryPool* MemoryService::add_cms_space(CompactibleFreeListSpace* space,
a61af66fc99e Initial load
duke
parents:
diff changeset
228 const char* name,
a61af66fc99e Initial load
duke
parents:
diff changeset
229 bool is_heap,
a61af66fc99e Initial load
duke
parents:
diff changeset
230 size_t max_size,
a61af66fc99e Initial load
duke
parents:
diff changeset
231 bool support_usage_threshold) {
a61af66fc99e Initial load
duke
parents:
diff changeset
232 MemoryPool::PoolType type = (is_heap ? MemoryPool::Heap : MemoryPool::NonHeap);
a61af66fc99e Initial load
duke
parents:
diff changeset
233 CompactibleFreeListSpacePool* pool = new CompactibleFreeListSpacePool(space, name, type, max_size, support_usage_threshold);
a61af66fc99e Initial load
duke
parents:
diff changeset
234 _pools_list->append(pool);
a61af66fc99e Initial load
duke
parents:
diff changeset
235 return (MemoryPool*) pool;
a61af66fc99e Initial load
duke
parents:
diff changeset
236 }
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
237 #endif // INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
238
a61af66fc99e Initial load
duke
parents:
diff changeset
239 // Add memory pool(s) for one generation
a61af66fc99e Initial load
duke
parents:
diff changeset
240 void MemoryService::add_generation_memory_pool(Generation* gen,
a61af66fc99e Initial load
duke
parents:
diff changeset
241 MemoryManager* major_mgr,
a61af66fc99e Initial load
duke
parents:
diff changeset
242 MemoryManager* minor_mgr) {
8761
8b4ce9870fd6 8009156: [parfait] Null pointer deference in hotspot/src/share/vm/services/memoryService.cpp
morris
parents: 8001
diff changeset
243 guarantee(gen != NULL, "No generation for memory pool");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
244 Generation::Name kind = gen->kind();
a61af66fc99e Initial load
duke
parents:
diff changeset
245 int index = _pools_list->length();
a61af66fc99e Initial load
duke
parents:
diff changeset
246
a61af66fc99e Initial load
duke
parents:
diff changeset
247 switch (kind) {
a61af66fc99e Initial load
duke
parents:
diff changeset
248 case Generation::DefNew: {
a61af66fc99e Initial load
duke
parents:
diff changeset
249 assert(major_mgr != NULL && minor_mgr != NULL, "Should have two managers");
a61af66fc99e Initial load
duke
parents:
diff changeset
250 DefNewGeneration* young_gen = (DefNewGeneration*) gen;
a61af66fc99e Initial load
duke
parents:
diff changeset
251 // Add a memory pool for each space and young gen doesn't
a61af66fc99e Initial load
duke
parents:
diff changeset
252 // support low memory detection as it is expected to get filled up.
a61af66fc99e Initial load
duke
parents:
diff changeset
253 MemoryPool* eden = add_space(young_gen->eden(),
a61af66fc99e Initial load
duke
parents:
diff changeset
254 "Eden Space",
a61af66fc99e Initial load
duke
parents:
diff changeset
255 true, /* is_heap */
a61af66fc99e Initial load
duke
parents:
diff changeset
256 young_gen->max_eden_size(),
a61af66fc99e Initial load
duke
parents:
diff changeset
257 false /* support_usage_threshold */);
a61af66fc99e Initial load
duke
parents:
diff changeset
258 MemoryPool* survivor = add_survivor_spaces(young_gen,
a61af66fc99e Initial load
duke
parents:
diff changeset
259 "Survivor Space",
a61af66fc99e Initial load
duke
parents:
diff changeset
260 true, /* is_heap */
a61af66fc99e Initial load
duke
parents:
diff changeset
261 young_gen->max_survivor_size(),
a61af66fc99e Initial load
duke
parents:
diff changeset
262 false /* support_usage_threshold */);
a61af66fc99e Initial load
duke
parents:
diff changeset
263 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
264 }
a61af66fc99e Initial load
duke
parents:
diff changeset
265
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
266 #if INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
267 case Generation::ParNew:
a61af66fc99e Initial load
duke
parents:
diff changeset
268 case Generation::ASParNew:
a61af66fc99e Initial load
duke
parents:
diff changeset
269 {
a61af66fc99e Initial load
duke
parents:
diff changeset
270 assert(major_mgr != NULL && minor_mgr != NULL, "Should have two managers");
a61af66fc99e Initial load
duke
parents:
diff changeset
271 // Add a memory pool for each space and young gen doesn't
a61af66fc99e Initial load
duke
parents:
diff changeset
272 // support low memory detection as it is expected to get filled up.
a61af66fc99e Initial load
duke
parents:
diff changeset
273 ParNewGeneration* parnew_gen = (ParNewGeneration*) gen;
a61af66fc99e Initial load
duke
parents:
diff changeset
274 MemoryPool* eden = add_space(parnew_gen->eden(),
a61af66fc99e Initial load
duke
parents:
diff changeset
275 "Par Eden Space",
a61af66fc99e Initial load
duke
parents:
diff changeset
276 true /* is_heap */,
a61af66fc99e Initial load
duke
parents:
diff changeset
277 parnew_gen->max_eden_size(),
a61af66fc99e Initial load
duke
parents:
diff changeset
278 false /* support_usage_threshold */);
a61af66fc99e Initial load
duke
parents:
diff changeset
279 MemoryPool* survivor = add_survivor_spaces(parnew_gen,
a61af66fc99e Initial load
duke
parents:
diff changeset
280 "Par Survivor Space",
a61af66fc99e Initial load
duke
parents:
diff changeset
281 true, /* is_heap */
a61af66fc99e Initial load
duke
parents:
diff changeset
282 parnew_gen->max_survivor_size(),
a61af66fc99e Initial load
duke
parents:
diff changeset
283 false /* support_usage_threshold */);
a61af66fc99e Initial load
duke
parents:
diff changeset
284
a61af66fc99e Initial load
duke
parents:
diff changeset
285 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
286 }
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
287 #endif // INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
288
a61af66fc99e Initial load
duke
parents:
diff changeset
289 case Generation::MarkSweepCompact: {
a61af66fc99e Initial load
duke
parents:
diff changeset
290 assert(major_mgr != NULL && minor_mgr == NULL, "Should have only one manager");
a61af66fc99e Initial load
duke
parents:
diff changeset
291 add_gen(gen,
a61af66fc99e Initial load
duke
parents:
diff changeset
292 "Tenured Gen",
a61af66fc99e Initial load
duke
parents:
diff changeset
293 true, /* is_heap */
a61af66fc99e Initial load
duke
parents:
diff changeset
294 true /* support_usage_threshold */);
a61af66fc99e Initial load
duke
parents:
diff changeset
295 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
296 }
a61af66fc99e Initial load
duke
parents:
diff changeset
297
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
298 #if INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
299 case Generation::ConcurrentMarkSweep:
a61af66fc99e Initial load
duke
parents:
diff changeset
300 case Generation::ASConcurrentMarkSweep:
a61af66fc99e Initial load
duke
parents:
diff changeset
301 {
a61af66fc99e Initial load
duke
parents:
diff changeset
302 assert(major_mgr != NULL && minor_mgr == NULL, "Should have only one manager");
a61af66fc99e Initial load
duke
parents:
diff changeset
303 ConcurrentMarkSweepGeneration* cms = (ConcurrentMarkSweepGeneration*) gen;
a61af66fc99e Initial load
duke
parents:
diff changeset
304 MemoryPool* pool = add_cms_space(cms->cmsSpace(),
a61af66fc99e Initial load
duke
parents:
diff changeset
305 "CMS Old Gen",
a61af66fc99e Initial load
duke
parents:
diff changeset
306 true, /* is_heap */
a61af66fc99e Initial load
duke
parents:
diff changeset
307 cms->reserved().byte_size(),
a61af66fc99e Initial load
duke
parents:
diff changeset
308 true /* support_usage_threshold */);
a61af66fc99e Initial load
duke
parents:
diff changeset
309 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
310 }
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
311 #endif // INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
312
a61af66fc99e Initial load
duke
parents:
diff changeset
313 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
314 assert(false, "should not reach here");
a61af66fc99e Initial load
duke
parents:
diff changeset
315 // no memory pool added for others
a61af66fc99e Initial load
duke
parents:
diff changeset
316 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
317 }
a61af66fc99e Initial load
duke
parents:
diff changeset
318
a61af66fc99e Initial load
duke
parents:
diff changeset
319 assert(major_mgr != NULL, "Should have at least one manager");
a61af66fc99e Initial load
duke
parents:
diff changeset
320 // Link managers and the memory pools together
a61af66fc99e Initial load
duke
parents:
diff changeset
321 for (int i = index; i < _pools_list->length(); i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
322 MemoryPool* pool = _pools_list->at(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
323 major_mgr->add_pool(pool);
a61af66fc99e Initial load
duke
parents:
diff changeset
324 if (minor_mgr != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
325 minor_mgr->add_pool(pool);
a61af66fc99e Initial load
duke
parents:
diff changeset
326 }
a61af66fc99e Initial load
duke
parents:
diff changeset
327 }
a61af66fc99e Initial load
duke
parents:
diff changeset
328 }
a61af66fc99e Initial load
duke
parents:
diff changeset
329
a61af66fc99e Initial load
duke
parents:
diff changeset
330
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
331 #if INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
332 void MemoryService::add_psYoung_memory_pool(PSYoungGen* gen, MemoryManager* major_mgr, MemoryManager* minor_mgr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
333 assert(major_mgr != NULL && minor_mgr != NULL, "Should have two managers");
a61af66fc99e Initial load
duke
parents:
diff changeset
334
a61af66fc99e Initial load
duke
parents:
diff changeset
335 // Add a memory pool for each space and young gen doesn't
a61af66fc99e Initial load
duke
parents:
diff changeset
336 // support low memory detection as it is expected to get filled up.
a61af66fc99e Initial load
duke
parents:
diff changeset
337 EdenMutableSpacePool* eden = new EdenMutableSpacePool(gen,
a61af66fc99e Initial load
duke
parents:
diff changeset
338 gen->eden_space(),
a61af66fc99e Initial load
duke
parents:
diff changeset
339 "PS Eden Space",
a61af66fc99e Initial load
duke
parents:
diff changeset
340 MemoryPool::Heap,
a61af66fc99e Initial load
duke
parents:
diff changeset
341 false /* support_usage_threshold */);
a61af66fc99e Initial load
duke
parents:
diff changeset
342
a61af66fc99e Initial load
duke
parents:
diff changeset
343 SurvivorMutableSpacePool* survivor = new SurvivorMutableSpacePool(gen,
a61af66fc99e Initial load
duke
parents:
diff changeset
344 "PS Survivor Space",
a61af66fc99e Initial load
duke
parents:
diff changeset
345 MemoryPool::Heap,
a61af66fc99e Initial load
duke
parents:
diff changeset
346 false /* support_usage_threshold */);
a61af66fc99e Initial load
duke
parents:
diff changeset
347
a61af66fc99e Initial load
duke
parents:
diff changeset
348 major_mgr->add_pool(eden);
a61af66fc99e Initial load
duke
parents:
diff changeset
349 major_mgr->add_pool(survivor);
a61af66fc99e Initial load
duke
parents:
diff changeset
350 minor_mgr->add_pool(eden);
a61af66fc99e Initial load
duke
parents:
diff changeset
351 minor_mgr->add_pool(survivor);
a61af66fc99e Initial load
duke
parents:
diff changeset
352 _pools_list->append(eden);
a61af66fc99e Initial load
duke
parents:
diff changeset
353 _pools_list->append(survivor);
a61af66fc99e Initial load
duke
parents:
diff changeset
354 }
a61af66fc99e Initial load
duke
parents:
diff changeset
355
a61af66fc99e Initial load
duke
parents:
diff changeset
356 void MemoryService::add_psOld_memory_pool(PSOldGen* gen, MemoryManager* mgr) {
a61af66fc99e Initial load
duke
parents:
diff changeset
357 PSGenerationPool* old_gen = new PSGenerationPool(gen,
a61af66fc99e Initial load
duke
parents:
diff changeset
358 "PS Old Gen",
a61af66fc99e Initial load
duke
parents:
diff changeset
359 MemoryPool::Heap,
a61af66fc99e Initial load
duke
parents:
diff changeset
360 true /* support_usage_threshold */);
a61af66fc99e Initial load
duke
parents:
diff changeset
361 mgr->add_pool(old_gen);
a61af66fc99e Initial load
duke
parents:
diff changeset
362 _pools_list->append(old_gen);
a61af66fc99e Initial load
duke
parents:
diff changeset
363 }
a61af66fc99e Initial load
duke
parents:
diff changeset
364
1089
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
365 void MemoryService::add_g1YoungGen_memory_pool(G1CollectedHeap* g1h,
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
366 MemoryManager* major_mgr,
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
367 MemoryManager* minor_mgr) {
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
368 assert(major_mgr != NULL && minor_mgr != NULL, "should have two managers");
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
369
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
370 G1EdenPool* eden = new G1EdenPool(g1h);
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
371 G1SurvivorPool* survivor = new G1SurvivorPool(g1h);
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
372
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
373 major_mgr->add_pool(eden);
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
374 major_mgr->add_pool(survivor);
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
375 minor_mgr->add_pool(eden);
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
376 minor_mgr->add_pool(survivor);
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
377 _pools_list->append(eden);
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
378 _pools_list->append(survivor);
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
379 }
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
380
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
381 void MemoryService::add_g1OldGen_memory_pool(G1CollectedHeap* g1h,
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
382 MemoryManager* mgr) {
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
383 assert(mgr != NULL, "should have one manager");
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
384
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
385 G1OldGenPool* old_gen = new G1OldGenPool(g1h);
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
386 mgr->add_pool(old_gen);
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
387 _pools_list->append(old_gen);
db0d5eba9d20 6815790: G1: Missing MemoryPoolMXBeans with -XX:+UseG1GC
tonyp
parents: 342
diff changeset
388 }
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
389 #endif // INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
390
a61af66fc99e Initial load
duke
parents:
diff changeset
391 void MemoryService::add_code_heap_memory_pool(CodeHeap* heap) {
a61af66fc99e Initial load
duke
parents:
diff changeset
392 _code_heap_pool = new CodeHeapPool(heap,
a61af66fc99e Initial load
duke
parents:
diff changeset
393 "Code Cache",
a61af66fc99e Initial load
duke
parents:
diff changeset
394 true /* support_usage_threshold */);
a61af66fc99e Initial load
duke
parents:
diff changeset
395 MemoryManager* mgr = MemoryManager::get_code_cache_memory_manager();
a61af66fc99e Initial load
duke
parents:
diff changeset
396 mgr->add_pool(_code_heap_pool);
a61af66fc99e Initial load
duke
parents:
diff changeset
397
a61af66fc99e Initial load
duke
parents:
diff changeset
398 _pools_list->append(_code_heap_pool);
a61af66fc99e Initial load
duke
parents:
diff changeset
399 _managers_list->append(mgr);
a61af66fc99e Initial load
duke
parents:
diff changeset
400 }
a61af66fc99e Initial load
duke
parents:
diff changeset
401
a61af66fc99e Initial load
duke
parents:
diff changeset
402 MemoryManager* MemoryService::get_memory_manager(instanceHandle mh) {
a61af66fc99e Initial load
duke
parents:
diff changeset
403 for (int i = 0; i < _managers_list->length(); i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
404 MemoryManager* mgr = _managers_list->at(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
405 if (mgr->is_manager(mh)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
406 return mgr;
a61af66fc99e Initial load
duke
parents:
diff changeset
407 }
a61af66fc99e Initial load
duke
parents:
diff changeset
408 }
a61af66fc99e Initial load
duke
parents:
diff changeset
409 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
410 }
a61af66fc99e Initial load
duke
parents:
diff changeset
411
a61af66fc99e Initial load
duke
parents:
diff changeset
412 MemoryPool* MemoryService::get_memory_pool(instanceHandle ph) {
a61af66fc99e Initial load
duke
parents:
diff changeset
413 for (int i = 0; i < _pools_list->length(); i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
414 MemoryPool* pool = _pools_list->at(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
415 if (pool->is_pool(ph)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
416 return pool;
a61af66fc99e Initial load
duke
parents:
diff changeset
417 }
a61af66fc99e Initial load
duke
parents:
diff changeset
418 }
a61af66fc99e Initial load
duke
parents:
diff changeset
419 return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
420 }
a61af66fc99e Initial load
duke
parents:
diff changeset
421
a61af66fc99e Initial load
duke
parents:
diff changeset
422 void MemoryService::track_memory_usage() {
a61af66fc99e Initial load
duke
parents:
diff changeset
423 // Track the peak memory usage
a61af66fc99e Initial load
duke
parents:
diff changeset
424 for (int i = 0; i < _pools_list->length(); i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
425 MemoryPool* pool = _pools_list->at(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
426 pool->record_peak_memory_usage();
a61af66fc99e Initial load
duke
parents:
diff changeset
427 }
a61af66fc99e Initial load
duke
parents:
diff changeset
428
a61af66fc99e Initial load
duke
parents:
diff changeset
429 // Detect low memory
a61af66fc99e Initial load
duke
parents:
diff changeset
430 LowMemoryDetector::detect_low_memory();
a61af66fc99e Initial load
duke
parents:
diff changeset
431 }
a61af66fc99e Initial load
duke
parents:
diff changeset
432
a61af66fc99e Initial load
duke
parents:
diff changeset
433 void MemoryService::track_memory_pool_usage(MemoryPool* pool) {
a61af66fc99e Initial load
duke
parents:
diff changeset
434 // Track the peak memory usage
a61af66fc99e Initial load
duke
parents:
diff changeset
435 pool->record_peak_memory_usage();
a61af66fc99e Initial load
duke
parents:
diff changeset
436
a61af66fc99e Initial load
duke
parents:
diff changeset
437 // Detect low memory
a61af66fc99e Initial load
duke
parents:
diff changeset
438 if (LowMemoryDetector::is_enabled(pool)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
439 LowMemoryDetector::detect_low_memory(pool);
a61af66fc99e Initial load
duke
parents:
diff changeset
440 }
a61af66fc99e Initial load
duke
parents:
diff changeset
441 }
a61af66fc99e Initial load
duke
parents:
diff changeset
442
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
443 void MemoryService::gc_begin(bool fullGC, bool recordGCBeginTime,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
444 bool recordAccumulatedGCTime,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
445 bool recordPreGCUsage, bool recordPeakUsage) {
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
446
0
a61af66fc99e Initial load
duke
parents:
diff changeset
447 GCMemoryManager* mgr;
a61af66fc99e Initial load
duke
parents:
diff changeset
448 if (fullGC) {
a61af66fc99e Initial load
duke
parents:
diff changeset
449 mgr = _major_gc_manager;
a61af66fc99e Initial load
duke
parents:
diff changeset
450 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
451 mgr = _minor_gc_manager;
a61af66fc99e Initial load
duke
parents:
diff changeset
452 }
a61af66fc99e Initial load
duke
parents:
diff changeset
453 assert(mgr->is_gc_memory_manager(), "Sanity check");
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
454 mgr->gc_begin(recordGCBeginTime, recordPreGCUsage, recordAccumulatedGCTime);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
455
a61af66fc99e Initial load
duke
parents:
diff changeset
456 // Track the peak memory usage when GC begins
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
457 if (recordPeakUsage) {
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
458 for (int i = 0; i < _pools_list->length(); i++) {
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
459 MemoryPool* pool = _pools_list->at(i);
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
460 pool->record_peak_memory_usage();
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
461 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
462 }
a61af66fc99e Initial load
duke
parents:
diff changeset
463 }
a61af66fc99e Initial load
duke
parents:
diff changeset
464
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
465 void MemoryService::gc_end(bool fullGC, bool recordPostGCUsage,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
466 bool recordAccumulatedGCTime,
3356
78542e2b5e35 7036199: Adding a notification to the implementation of GarbageCollectorMXBeans
fparain
parents: 2426
diff changeset
467 bool recordGCEndTime, bool countCollection,
78542e2b5e35 7036199: Adding a notification to the implementation of GarbageCollectorMXBeans
fparain
parents: 2426
diff changeset
468 GCCause::Cause cause) {
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
469
0
a61af66fc99e Initial load
duke
parents:
diff changeset
470 GCMemoryManager* mgr;
a61af66fc99e Initial load
duke
parents:
diff changeset
471 if (fullGC) {
a61af66fc99e Initial load
duke
parents:
diff changeset
472 mgr = (GCMemoryManager*) _major_gc_manager;
a61af66fc99e Initial load
duke
parents:
diff changeset
473 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
474 mgr = (GCMemoryManager*) _minor_gc_manager;
a61af66fc99e Initial load
duke
parents:
diff changeset
475 }
a61af66fc99e Initial load
duke
parents:
diff changeset
476 assert(mgr->is_gc_memory_manager(), "Sanity check");
a61af66fc99e Initial load
duke
parents:
diff changeset
477
a61af66fc99e Initial load
duke
parents:
diff changeset
478 // register the GC end statistics and memory usage
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
479 mgr->gc_end(recordPostGCUsage, recordAccumulatedGCTime, recordGCEndTime,
3356
78542e2b5e35 7036199: Adding a notification to the implementation of GarbageCollectorMXBeans
fparain
parents: 2426
diff changeset
480 countCollection, cause);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
481 }
a61af66fc99e Initial load
duke
parents:
diff changeset
482
a61af66fc99e Initial load
duke
parents:
diff changeset
483 void MemoryService::oops_do(OopClosure* f) {
a61af66fc99e Initial load
duke
parents:
diff changeset
484 int i;
a61af66fc99e Initial load
duke
parents:
diff changeset
485
a61af66fc99e Initial load
duke
parents:
diff changeset
486 for (i = 0; i < _pools_list->length(); i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
487 MemoryPool* pool = _pools_list->at(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
488 pool->oops_do(f);
a61af66fc99e Initial load
duke
parents:
diff changeset
489 }
a61af66fc99e Initial load
duke
parents:
diff changeset
490 for (i = 0; i < _managers_list->length(); i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
491 MemoryManager* mgr = _managers_list->at(i);
a61af66fc99e Initial load
duke
parents:
diff changeset
492 mgr->oops_do(f);
a61af66fc99e Initial load
duke
parents:
diff changeset
493 }
a61af66fc99e Initial load
duke
parents:
diff changeset
494 }
a61af66fc99e Initial load
duke
parents:
diff changeset
495
a61af66fc99e Initial load
duke
parents:
diff changeset
496 bool MemoryService::set_verbose(bool verbose) {
a61af66fc99e Initial load
duke
parents:
diff changeset
497 MutexLocker m(Management_lock);
a61af66fc99e Initial load
duke
parents:
diff changeset
498 // verbose will be set to the previous value
a61af66fc99e Initial load
duke
parents:
diff changeset
499 bool succeed = CommandLineFlags::boolAtPut((char*)"PrintGC", &verbose, MANAGEMENT);
a61af66fc99e Initial load
duke
parents:
diff changeset
500 assert(succeed, "Setting PrintGC flag fails");
a61af66fc99e Initial load
duke
parents:
diff changeset
501 ClassLoadingService::reset_trace_class_unloading();
a61af66fc99e Initial load
duke
parents:
diff changeset
502
a61af66fc99e Initial load
duke
parents:
diff changeset
503 return verbose;
a61af66fc99e Initial load
duke
parents:
diff changeset
504 }
a61af66fc99e Initial load
duke
parents:
diff changeset
505
a61af66fc99e Initial load
duke
parents:
diff changeset
506 Handle MemoryService::create_MemoryUsage_obj(MemoryUsage usage, TRAPS) {
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6197
diff changeset
507 Klass* k = Management::java_lang_management_MemoryUsage_klass(CHECK_NH);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
508 instanceKlassHandle ik(THREAD, k);
a61af66fc99e Initial load
duke
parents:
diff changeset
509
a61af66fc99e Initial load
duke
parents:
diff changeset
510 instanceHandle obj = ik->allocate_instance_handle(CHECK_NH);
a61af66fc99e Initial load
duke
parents:
diff changeset
511
a61af66fc99e Initial load
duke
parents:
diff changeset
512 JavaValue result(T_VOID);
a61af66fc99e Initial load
duke
parents:
diff changeset
513 JavaCallArguments args(10);
a61af66fc99e Initial load
duke
parents:
diff changeset
514 args.push_oop(obj); // receiver
a61af66fc99e Initial load
duke
parents:
diff changeset
515 args.push_long(usage.init_size_as_jlong()); // Argument 1
a61af66fc99e Initial load
duke
parents:
diff changeset
516 args.push_long(usage.used_as_jlong()); // Argument 2
a61af66fc99e Initial load
duke
parents:
diff changeset
517 args.push_long(usage.committed_as_jlong()); // Argument 3
a61af66fc99e Initial load
duke
parents:
diff changeset
518 args.push_long(usage.max_size_as_jlong()); // Argument 4
a61af66fc99e Initial load
duke
parents:
diff changeset
519
a61af66fc99e Initial load
duke
parents:
diff changeset
520 JavaCalls::call_special(&result,
a61af66fc99e Initial load
duke
parents:
diff changeset
521 ik,
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
522 vmSymbols::object_initializer_name(),
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
523 vmSymbols::long_long_long_long_void_signature(),
0
a61af66fc99e Initial load
duke
parents:
diff changeset
524 &args,
a61af66fc99e Initial load
duke
parents:
diff changeset
525 CHECK_NH);
a61af66fc99e Initial load
duke
parents:
diff changeset
526 return obj;
a61af66fc99e Initial load
duke
parents:
diff changeset
527 }
a61af66fc99e Initial load
duke
parents:
diff changeset
528 //
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
529 // GC manager type depends on the type of Generation. Depending on the space
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
530 // availablity and vm options the gc uses major gc manager or minor gc
0
a61af66fc99e Initial load
duke
parents:
diff changeset
531 // manager or both. The type of gc manager depends on the generation kind.
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
532 // For DefNew, ParNew and ASParNew generation doing scavenge gc uses minor
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
533 // gc manager (so _fullGC is set to false ) and for other generation kinds
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
534 // doing mark-sweep-compact uses major gc manager (so _fullGC is set
0
a61af66fc99e Initial load
duke
parents:
diff changeset
535 // to true).
3356
78542e2b5e35 7036199: Adding a notification to the implementation of GarbageCollectorMXBeans
fparain
parents: 2426
diff changeset
536 TraceMemoryManagerStats::TraceMemoryManagerStats(Generation::Name kind, GCCause::Cause cause) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
537 switch (kind) {
a61af66fc99e Initial load
duke
parents:
diff changeset
538 case Generation::DefNew:
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
539 #if INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
540 case Generation::ParNew:
a61af66fc99e Initial load
duke
parents:
diff changeset
541 case Generation::ASParNew:
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
542 #endif // INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
543 _fullGC=false;
a61af66fc99e Initial load
duke
parents:
diff changeset
544 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
545 case Generation::MarkSweepCompact:
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
546 #if INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
547 case Generation::ConcurrentMarkSweep:
a61af66fc99e Initial load
duke
parents:
diff changeset
548 case Generation::ASConcurrentMarkSweep:
8001
db9981fd3124 8005915: Unify SERIALGC and INCLUDE_ALTERNATE_GCS
jprovino
parents: 6725
diff changeset
549 #endif // INCLUDE_ALL_GCS
0
a61af66fc99e Initial load
duke
parents:
diff changeset
550 _fullGC=true;
a61af66fc99e Initial load
duke
parents:
diff changeset
551 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
552 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
553 assert(false, "Unrecognized gc generation kind.");
a61af66fc99e Initial load
duke
parents:
diff changeset
554 }
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
555 // this has to be called in a stop the world pause and represent
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
556 // an entire gc pause, start to finish:
3356
78542e2b5e35 7036199: Adding a notification to the implementation of GarbageCollectorMXBeans
fparain
parents: 2426
diff changeset
557 initialize(_fullGC, cause,true, true, true, true, true, true, true);
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
558 }
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
559 TraceMemoryManagerStats::TraceMemoryManagerStats(bool fullGC,
3356
78542e2b5e35 7036199: Adding a notification to the implementation of GarbageCollectorMXBeans
fparain
parents: 2426
diff changeset
560 GCCause::Cause cause,
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
561 bool recordGCBeginTime,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
562 bool recordPreGCUsage,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
563 bool recordPeakUsage,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
564 bool recordPostGCUsage,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
565 bool recordAccumulatedGCTime,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
566 bool recordGCEndTime,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
567 bool countCollection) {
3356
78542e2b5e35 7036199: Adding a notification to the implementation of GarbageCollectorMXBeans
fparain
parents: 2426
diff changeset
568 initialize(fullGC, cause, recordGCBeginTime, recordPreGCUsage, recordPeakUsage,
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
569 recordPostGCUsage, recordAccumulatedGCTime, recordGCEndTime,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
570 countCollection);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
571 }
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
572
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
573 // for a subclass to create then initialize an instance before invoking
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
574 // the MemoryService
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
575 void TraceMemoryManagerStats::initialize(bool fullGC,
3356
78542e2b5e35 7036199: Adding a notification to the implementation of GarbageCollectorMXBeans
fparain
parents: 2426
diff changeset
576 GCCause::Cause cause,
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
577 bool recordGCBeginTime,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
578 bool recordPreGCUsage,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
579 bool recordPeakUsage,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
580 bool recordPostGCUsage,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
581 bool recordAccumulatedGCTime,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
582 bool recordGCEndTime,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
583 bool countCollection) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
584 _fullGC = fullGC;
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
585 _recordGCBeginTime = recordGCBeginTime;
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
586 _recordPreGCUsage = recordPreGCUsage;
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
587 _recordPeakUsage = recordPeakUsage;
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
588 _recordPostGCUsage = recordPostGCUsage;
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
589 _recordAccumulatedGCTime = recordAccumulatedGCTime;
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
590 _recordGCEndTime = recordGCEndTime;
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
591 _countCollection = countCollection;
3356
78542e2b5e35 7036199: Adding a notification to the implementation of GarbageCollectorMXBeans
fparain
parents: 2426
diff changeset
592 _cause = cause;
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
593
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
594 MemoryService::gc_begin(_fullGC, _recordGCBeginTime, _recordAccumulatedGCTime,
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
595 _recordPreGCUsage, _recordPeakUsage);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
596 }
a61af66fc99e Initial load
duke
parents:
diff changeset
597
a61af66fc99e Initial load
duke
parents:
diff changeset
598 TraceMemoryManagerStats::~TraceMemoryManagerStats() {
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
599 MemoryService::gc_end(_fullGC, _recordPostGCUsage, _recordAccumulatedGCTime,
3356
78542e2b5e35 7036199: Adding a notification to the implementation of GarbageCollectorMXBeans
fparain
parents: 2426
diff changeset
600 _recordGCEndTime, _countCollection, _cause);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
601 }
1703
f6f3eef8a521 6581734: CMS Old Gen's collection usage is zero after GC which is incorrect
kevinw
parents: 1552
diff changeset
602