[root@dataflow_cms ~]# jps
26966 dataflow.jar
14701 Jps
25774 Application
[root@dataflow_cms ~]# 26966
-bash: 26966: command not found
[root@dataflow_cms ~]# jmap -heap 26966
Attaching to process ID 26966, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.45-b02
using thread-local object allocation.
Mark Sweep Compact GC
Heap Configuration:
MinHeapFreeRatio = 40
MaxHeapFreeRatio = 70
MaxHeapSize = 994050048 (948.0MB)
NewSize = 20971520 (20.0MB)
MaxNewSize = 331350016 (316.0MB)
OldSize = 41943040 (40.0MB)
NewRatio = 2
SurvivorRatio = 8
MetaspaceSize = 21807104 (20.796875MB)
CompressedClassSpaceSize = 1073741824 (1024.0MB)
MaxMetaspaceSize = 17592186044415 MB
G1HeapRegionSize = 0 (0.0MB)
Heap Usage:
New Generation (Eden + 1 Survivor Space):
capacity = 94961664 (90.5625MB)
used = 38471872 (36.68963623046875MB)
free = 56489792 (53.87286376953125MB)
40.51305587905452% used
Eden Space:
capacity = 84475904 (80.5625MB)
used = 38342992 (36.56672668457031MB)
free = 46132912 (43.99577331542969MB)
45.38926508557991% used
From Space:
capacity = 10485760 (10.0MB)
used = 128880 (0.1229095458984375MB)
free = 10356880 (9.877090454101562MB)
1.229095458984375% used
To Space:
capacity = 10485760 (10.0MB)
used = 0 (0.0MB)
free = 10485760 (10.0MB)
0.0% used
tenured generation:
capacity = 210644992 (200.88671875MB)
used = 205237512 (195.72974395751953MB)
free = 5407480 (5.156974792480469MB)
97.43289410839637% used
30043 interned Strings occupying 3489056 bytes.
[root@dataflow_cms ~]# jmap -histo:live 26966 > zuo.txt
[root@dataflow_cms ~]# more zuo.txt
num #instances #bytes class name
----------------------------------------------
1: 463555 30091328 [C
2: 393016 12576512 java.util.HashMap$Node
3: 460209 11045016 java.lang.String
4: 7330 2806344 [B
5: 7793 2750744 [Ljava.util.HashMap$Node;
6: 62269 1992608 java.util.concurrent.ConcurrentHashMap$Node
7: 16039 1782704 java.lang.Class
8: 15628 1375264 java.lang.reflect.Method
9: 15833 1286768 [Ljava.lang.Object;
10: 7147 1100160 [I
11: 17066 682640 java.util.LinkedHashMap$Entry
12: 35866 573856 java.lang.Object
13: 336 509448 [Ljava.util.concurrent.ConcurrentHashMap$Node;
14: 9037 506072 java.util.LinkedHashMap
15: 11808 267344 [Ljava.lang.Class;
16: 7461 179064 java.util.ArrayList
17: 3478 165848 [Ljava.lang.String;
18: 6357 152568 org.springframework.core.MethodClassKey
19: 3452 138080 java.lang.ref.SoftReference
20: 1528 122240 java.lang.reflect.Constructor
21: 2531 121488 java.util.HashMap
22: 156 102336 io.netty.util.internal.shaded.org.jctools.queues.MpscArrayQueue
23: 1720 96320 java.lang.invoke.MemberName
24: 1320 95040 org.springframework.core.annotation.AnnotationAttributes
25: 2239 89560 java.util.TreeMap$Entry
26: 749 83888 org.springframework.boot.loader.jar.JarEntry
27: 1325 74200 java.lang.Package
28: 2178 69696 java.util.LinkedList
29: 952 68544 java.lang.reflect.Field
30: 1409 67632 org.springframework.core.ResolvableType
31: 2801 67224 java.util.LinkedList$Node
32: 2 65568 [Ljava.util.concurrent.ForkJoinTask;
33: 2000 64000 com.mysql.cj.conf.BooleanProperty
34: 2652 63648 javassist.bytecode.Utf8Info
35: 16 61696 [Ljava.nio.ByteBuffer;
36: 3674 58784 java.util.LinkedHashSet
37: 1374 54960 java.lang.invoke.MethodType
38: 2102 50448 sun.reflect.generics.tree.SimpleClassTypeSignature
39: 302 47472 [Z
40: 741 47424 java.util.concurrent.ConcurrentHashMap
获取排名前20
jmap -histo:live 26966 | head -20