author | shade |
Tue, 12 Jun 2018 15:03:00 +0200 | |
changeset 50523 | 7b7c75d87f9b |
parent 50445 | bd6b78feb6a3 |
child 50525 | 767cdb97f103 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
49463
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. |
1 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1217
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1217
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1217
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
25 |
package sun.jvm.hotspot.tools; |
|
26 |
||
27 |
import java.util.*; |
|
50523
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
50445
diff
changeset
|
28 |
import sun.jvm.hotspot.gc.epsilon.*; |
30764 | 29 |
import sun.jvm.hotspot.gc.g1.*; |
30 |
import sun.jvm.hotspot.gc.parallel.*; |
|
30769 | 31 |
import sun.jvm.hotspot.gc.serial.*; |
30764 | 32 |
import sun.jvm.hotspot.gc.shared.*; |
18481
fa7f6ad24216
8010278: SA: provide mechanism for using an alternative SA debugger back-end.
kevinw
parents:
15811
diff
changeset
|
33 |
import sun.jvm.hotspot.debugger.JVMDebugger; |
1 | 34 |
import sun.jvm.hotspot.memory.*; |
10985
f529e2356036
7108242: jinfo -permstat shouldn't report interned strings as part of perm
never
parents:
10675
diff
changeset
|
35 |
import sun.jvm.hotspot.oops.*; |
1 | 36 |
import sun.jvm.hotspot.runtime.*; |
37 |
||
38261
ddf6760621fc
8155091: Remove SA related functions from tmtools
dsamersoff
parents:
36508
diff
changeset
|
38 |
public class HeapSummary extends Tool { |
1 | 39 |
|
18481
fa7f6ad24216
8010278: SA: provide mechanism for using an alternative SA debugger back-end.
kevinw
parents:
15811
diff
changeset
|
40 |
public HeapSummary() { |
fa7f6ad24216
8010278: SA: provide mechanism for using an alternative SA debugger back-end.
kevinw
parents:
15811
diff
changeset
|
41 |
super(); |
fa7f6ad24216
8010278: SA: provide mechanism for using an alternative SA debugger back-end.
kevinw
parents:
15811
diff
changeset
|
42 |
} |
fa7f6ad24216
8010278: SA: provide mechanism for using an alternative SA debugger back-end.
kevinw
parents:
15811
diff
changeset
|
43 |
|
fa7f6ad24216
8010278: SA: provide mechanism for using an alternative SA debugger back-end.
kevinw
parents:
15811
diff
changeset
|
44 |
public HeapSummary(JVMDebugger d) { |
fa7f6ad24216
8010278: SA: provide mechanism for using an alternative SA debugger back-end.
kevinw
parents:
15811
diff
changeset
|
45 |
super(d); |
fa7f6ad24216
8010278: SA: provide mechanism for using an alternative SA debugger back-end.
kevinw
parents:
15811
diff
changeset
|
46 |
} |
fa7f6ad24216
8010278: SA: provide mechanism for using an alternative SA debugger back-end.
kevinw
parents:
15811
diff
changeset
|
47 |
|
1 | 48 |
public static void main(String[] args) { |
49 |
HeapSummary hs = new HeapSummary(); |
|
21065
b8281f54308b
8025638: jmap returns 0 instead of 1 when it fails.
farvidsson
parents:
19979
diff
changeset
|
50 |
hs.execute(args); |
1 | 51 |
} |
52 |
||
36508 | 53 |
@Override |
54 |
public String getName() { |
|
55 |
return "heapSummary"; |
|
56 |
} |
|
57 |
||
1 | 58 |
public void run() { |
59 |
CollectedHeap heap = VM.getVM().getUniverse().heap(); |
|
60 |
VM.Flag[] flags = VM.getVM().getCommandLineFlags(); |
|
61 |
Map flagMap = new HashMap(); |
|
62 |
if (flags == null) { |
|
63 |
System.out.println("WARNING: command line flags are not available"); |
|
64 |
} else { |
|
65 |
for (int f = 0; f < flags.length; f++) { |
|
66 |
flagMap.put(flags[f].getName(), flags[f]); |
|
67 |
} |
|
68 |
} |
|
69 |
||
70 |
System.out.println(); |
|
71 |
printGCAlgorithm(flagMap); |
|
72 |
System.out.println(); |
|
73 |
System.out.println("Heap Configuration:"); |
|
19979
ebe1dbb6e1aa
8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents:
18481
diff
changeset
|
74 |
printValue("MinHeapFreeRatio = ", getFlagValue("MinHeapFreeRatio", flagMap)); |
ebe1dbb6e1aa
8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents:
18481
diff
changeset
|
75 |
printValue("MaxHeapFreeRatio = ", getFlagValue("MaxHeapFreeRatio", flagMap)); |
ebe1dbb6e1aa
8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents:
18481
diff
changeset
|
76 |
printValMB("MaxHeapSize = ", getFlagValue("MaxHeapSize", flagMap)); |
ebe1dbb6e1aa
8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents:
18481
diff
changeset
|
77 |
printValMB("NewSize = ", getFlagValue("NewSize", flagMap)); |
ebe1dbb6e1aa
8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents:
18481
diff
changeset
|
78 |
printValMB("MaxNewSize = ", getFlagValue("MaxNewSize", flagMap)); |
ebe1dbb6e1aa
8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents:
18481
diff
changeset
|
79 |
printValMB("OldSize = ", getFlagValue("OldSize", flagMap)); |
ebe1dbb6e1aa
8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents:
18481
diff
changeset
|
80 |
printValue("NewRatio = ", getFlagValue("NewRatio", flagMap)); |
ebe1dbb6e1aa
8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents:
18481
diff
changeset
|
81 |
printValue("SurvivorRatio = ", getFlagValue("SurvivorRatio", flagMap)); |
ebe1dbb6e1aa
8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents:
18481
diff
changeset
|
82 |
printValMB("MetaspaceSize = ", getFlagValue("MetaspaceSize", flagMap)); |
ebe1dbb6e1aa
8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents:
18481
diff
changeset
|
83 |
printValMB("CompressedClassSpaceSize = ", getFlagValue("CompressedClassSpaceSize", flagMap)); |
ebe1dbb6e1aa
8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents:
18481
diff
changeset
|
84 |
printValMB("MaxMetaspaceSize = ", getFlagValue("MaxMetaspaceSize", flagMap)); |
ebe1dbb6e1aa
8015107: NPG: Use consistent naming for metaspace concepts
ehelin
parents:
18481
diff
changeset
|
85 |
printValMB("G1HeapRegionSize = ", HeapRegion.grainBytes()); |
1 | 86 |
|
87 |
System.out.println(); |
|
88 |
System.out.println("Heap Usage:"); |
|
89 |
||
30154 | 90 |
if (heap instanceof GenCollectedHeap) { |
91 |
GenCollectedHeap genHeap = (GenCollectedHeap) heap; |
|
92 |
for (int n = 0; n < genHeap.nGens(); n++) { |
|
93 |
Generation gen = genHeap.getGen(n); |
|
30769 | 94 |
if (gen instanceof DefNewGeneration) { |
30154 | 95 |
System.out.println("New Generation (Eden + 1 Survivor Space):"); |
96 |
printGen(gen); |
|
1 | 97 |
|
30154 | 98 |
ContiguousSpace eden = ((DefNewGeneration)gen).eden(); |
99 |
System.out.println("Eden Space:"); |
|
100 |
printSpace(eden); |
|
10663 | 101 |
|
30154 | 102 |
ContiguousSpace from = ((DefNewGeneration)gen).from(); |
103 |
System.out.println("From Space:"); |
|
104 |
printSpace(from); |
|
1 | 105 |
|
30154 | 106 |
ContiguousSpace to = ((DefNewGeneration)gen).to(); |
107 |
System.out.println("To Space:"); |
|
108 |
printSpace(to); |
|
109 |
} else { |
|
110 |
System.out.println(gen.name() + ":"); |
|
111 |
printGen(gen); |
|
10663 | 112 |
} |
1 | 113 |
} |
30154 | 114 |
} else if (heap instanceof G1CollectedHeap) { |
49463
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
115 |
printG1HeapSummary((G1CollectedHeap)heap); |
1 | 116 |
} else if (heap instanceof ParallelScavengeHeap) { |
117 |
ParallelScavengeHeap psh = (ParallelScavengeHeap) heap; |
|
118 |
PSYoungGen youngGen = psh.youngGen(); |
|
119 |
printPSYoungGen(youngGen); |
|
120 |
||
121 |
PSOldGen oldGen = psh.oldGen(); |
|
122 |
long oldFree = oldGen.capacity() - oldGen.used(); |
|
123 |
System.out.println("PS Old Generation"); |
|
124 |
printValMB("capacity = ", oldGen.capacity()); |
|
125 |
printValMB("used = ", oldGen.used()); |
|
126 |
printValMB("free = ", oldFree); |
|
127 |
System.out.println(alignment + (double)oldGen.used() * 100.0 / oldGen.capacity() + "% used"); |
|
50523
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
50445
diff
changeset
|
128 |
} else if (heap instanceof EpsilonHeap) { |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
50445
diff
changeset
|
129 |
EpsilonHeap eh = (EpsilonHeap) heap; |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
50445
diff
changeset
|
130 |
printSpace(eh.space()); |
1 | 131 |
} else { |
10663 | 132 |
throw new RuntimeException("unknown CollectedHeap type : " + heap.getClass()); |
1 | 133 |
} |
10985
f529e2356036
7108242: jinfo -permstat shouldn't report interned strings as part of perm
never
parents:
10675
diff
changeset
|
134 |
|
f529e2356036
7108242: jinfo -permstat shouldn't report interned strings as part of perm
never
parents:
10675
diff
changeset
|
135 |
System.out.println(); |
1 | 136 |
} |
137 |
||
138 |
// Helper methods |
|
139 |
||
140 |
private void printGCAlgorithm(Map flagMap) { |
|
43605
07baf498d588
8173421: Obsolete and expired flags for JDK 10 need to be removed and related tests updated
dholmes
parents:
38261
diff
changeset
|
141 |
long l = getFlagValue("UseTLAB", flagMap); |
1 | 142 |
if (l == 1L) { |
143 |
System.out.println("using thread-local object allocation."); |
|
144 |
} |
|
145 |
||
146 |
l = getFlagValue("UseConcMarkSweepGC", flagMap); |
|
147 |
if (l == 1L) { |
|
148 |
System.out.println("Concurrent Mark-Sweep GC"); |
|
149 |
return; |
|
150 |
} |
|
151 |
||
152 |
l = getFlagValue("UseParallelGC", flagMap); |
|
153 |
if (l == 1L) { |
|
154 |
System.out.print("Parallel GC "); |
|
155 |
l = getFlagValue("ParallelGCThreads", flagMap); |
|
156 |
System.out.println("with " + l + " thread(s)"); |
|
157 |
return; |
|
158 |
} |
|
159 |
||
10663 | 160 |
l = getFlagValue("UseG1GC", flagMap); |
161 |
if (l == 1L) { |
|
162 |
System.out.print("Garbage-First (G1) GC "); |
|
163 |
l = getFlagValue("ParallelGCThreads", flagMap); |
|
164 |
System.out.println("with " + l + " thread(s)"); |
|
165 |
return; |
|
166 |
} |
|
167 |
||
50523
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
50445
diff
changeset
|
168 |
l = getFlagValue("UseEpsilonGC", flagMap); |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
50445
diff
changeset
|
169 |
if (l == 1L) { |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
50445
diff
changeset
|
170 |
System.out.println("Epsilon (no-op) GC"); |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
50445
diff
changeset
|
171 |
return; |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
50445
diff
changeset
|
172 |
} |
7b7c75d87f9b
8204180: Implementation: JEP 318: Epsilon, A No-Op Garbage Collector
shade
parents:
50445
diff
changeset
|
173 |
|
1 | 174 |
System.out.println("Mark Sweep Compact GC"); |
175 |
} |
|
176 |
||
177 |
private void printPSYoungGen(PSYoungGen youngGen) { |
|
178 |
System.out.println("PS Young Generation"); |
|
179 |
MutableSpace eden = youngGen.edenSpace(); |
|
180 |
System.out.println("Eden Space:"); |
|
181 |
printMutableSpace(eden); |
|
182 |
MutableSpace from = youngGen.fromSpace(); |
|
183 |
System.out.println("From Space:"); |
|
184 |
printMutableSpace(from); |
|
185 |
MutableSpace to = youngGen.toSpace(); |
|
186 |
System.out.println("To Space:"); |
|
187 |
printMutableSpace(to); |
|
188 |
} |
|
189 |
||
190 |
private void printMutableSpace(MutableSpace space) { |
|
191 |
printValMB("capacity = ", space.capacity()); |
|
192 |
printValMB("used = ", space.used()); |
|
193 |
long free = space.capacity() - space.used(); |
|
194 |
printValMB("free = ", free); |
|
195 |
System.out.println(alignment + (double)space.used() * 100.0 / space.capacity() + "% used"); |
|
196 |
} |
|
197 |
||
198 |
private static String alignment = " "; |
|
199 |
||
200 |
private void printGen(Generation gen) { |
|
201 |
printValMB("capacity = ", gen.capacity()); |
|
202 |
printValMB("used = ", gen.used()); |
|
203 |
printValMB("free = ", gen.free()); |
|
204 |
System.out.println(alignment + (double)gen.used() * 100.0 / gen.capacity() + "% used"); |
|
205 |
} |
|
206 |
||
207 |
private void printSpace(ContiguousSpace space) { |
|
208 |
printValMB("capacity = ", space.capacity()); |
|
209 |
printValMB("used = ", space.used()); |
|
210 |
printValMB("free = ", space.free()); |
|
211 |
System.out.println(alignment + (double)space.used() * 100.0 / space.capacity() + "% used"); |
|
212 |
} |
|
213 |
||
49463
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
214 |
public void printG1HeapSummary(G1CollectedHeap g1h) { |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
215 |
G1MonitoringSupport g1mm = g1h.g1mm(); |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
216 |
long edenRegionNum = g1mm.edenRegionNum(); |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
217 |
long survivorRegionNum = g1mm.survivorRegionNum(); |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
218 |
HeapRegionSetBase oldSet = g1h.oldSet(); |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
219 |
HeapRegionSetBase humongousSet = g1h.humongousSet(); |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
220 |
long oldRegionNum = oldSet.length() + humongousSet.length(); |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
221 |
printG1Space("G1 Heap:", g1h.n_regions(), |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
222 |
g1h.used(), g1h.capacity()); |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
223 |
System.out.println("G1 Young Generation:"); |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
224 |
printG1Space("Eden Space:", edenRegionNum, |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
225 |
g1mm.edenUsed(), g1mm.edenCommitted()); |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
226 |
printG1Space("Survivor Space:", survivorRegionNum, |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
227 |
g1mm.survivorUsed(), g1mm.survivorCommitted()); |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
228 |
printG1Space("G1 Old Generation:", oldRegionNum, |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
229 |
g1mm.oldUsed(), g1mm.oldCommitted()); |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
230 |
} |
ccb003941743
8175312: SA: clhsdb: Provide an improved heap summary for 'universe' for G1GC
jgeorge
parents:
47216
diff
changeset
|
231 |
|
11577
0af7e6e062a7
7097586: G1: improve the per-space output when using jmap -heap
tonyp
parents:
10985
diff
changeset
|
232 |
private void printG1Space(String spaceName, long regionNum, |
0af7e6e062a7
7097586: G1: improve the per-space output when using jmap -heap
tonyp
parents:
10985
diff
changeset
|
233 |
long used, long capacity) { |
10675
8b887b2cb116
7097048: G1: extend the G1 SA changes to print per-heap space information
tonyp
parents:
10663
diff
changeset
|
234 |
long free = capacity - used; |
8b887b2cb116
7097048: G1: extend the G1 SA changes to print per-heap space information
tonyp
parents:
10663
diff
changeset
|
235 |
System.out.println(spaceName); |
11577
0af7e6e062a7
7097586: G1: improve the per-space output when using jmap -heap
tonyp
parents:
10985
diff
changeset
|
236 |
printValue("regions = ", regionNum); |
10675
8b887b2cb116
7097048: G1: extend the G1 SA changes to print per-heap space information
tonyp
parents:
10663
diff
changeset
|
237 |
printValMB("capacity = ", capacity); |
8b887b2cb116
7097048: G1: extend the G1 SA changes to print per-heap space information
tonyp
parents:
10663
diff
changeset
|
238 |
printValMB("used = ", used); |
8b887b2cb116
7097048: G1: extend the G1 SA changes to print per-heap space information
tonyp
parents:
10663
diff
changeset
|
239 |
printValMB("free = ", free); |
8b887b2cb116
7097048: G1: extend the G1 SA changes to print per-heap space information
tonyp
parents:
10663
diff
changeset
|
240 |
double occPerc = (capacity > 0) ? (double) used * 100.0 / capacity : 0.0; |
8b887b2cb116
7097048: G1: extend the G1 SA changes to print per-heap space information
tonyp
parents:
10663
diff
changeset
|
241 |
System.out.println(alignment + occPerc + "% used"); |
8b887b2cb116
7097048: G1: extend the G1 SA changes to print per-heap space information
tonyp
parents:
10663
diff
changeset
|
242 |
} |
8b887b2cb116
7097048: G1: extend the G1 SA changes to print per-heap space information
tonyp
parents:
10663
diff
changeset
|
243 |
|
1 | 244 |
private static final double FACTOR = 1024*1024; |
245 |
private void printValMB(String title, long value) { |
|
989
04e4dadeec8a
6718125: SA: jmap prints negative size for MaxNewHeap.
swamyv
parents:
1
diff
changeset
|
246 |
if (value < 0) { |
04e4dadeec8a
6718125: SA: jmap prints negative size for MaxNewHeap.
swamyv
parents:
1
diff
changeset
|
247 |
System.out.println(alignment + title + (value >>> 20) + " MB"); |
04e4dadeec8a
6718125: SA: jmap prints negative size for MaxNewHeap.
swamyv
parents:
1
diff
changeset
|
248 |
} else { |
04e4dadeec8a
6718125: SA: jmap prints negative size for MaxNewHeap.
swamyv
parents:
1
diff
changeset
|
249 |
double mb = value/FACTOR; |
04e4dadeec8a
6718125: SA: jmap prints negative size for MaxNewHeap.
swamyv
parents:
1
diff
changeset
|
250 |
System.out.println(alignment + title + value + " (" + mb + "MB)"); |
04e4dadeec8a
6718125: SA: jmap prints negative size for MaxNewHeap.
swamyv
parents:
1
diff
changeset
|
251 |
} |
1 | 252 |
} |
253 |
||
254 |
private void printValue(String title, long value) { |
|
255 |
System.out.println(alignment + title + value); |
|
256 |
} |
|
257 |
||
258 |
private long getFlagValue(String name, Map flagMap) { |
|
259 |
VM.Flag f = (VM.Flag) flagMap.get(name); |
|
260 |
if (f != null) { |
|
261 |
if (f.isBool()) { |
|
262 |
return f.getBool()? 1L : 0L; |
|
263 |
} else { |
|
264 |
return Long.parseLong(f.getValue()); |
|
265 |
} |
|
266 |
} else { |
|
267 |
return -1; |
|
268 |
} |
|
269 |
} |
|
270 |
} |