Skip to content

Commit 074f340

Browse files
committed
jmap 部分
1 parent 2d2dfc5 commit 074f340

File tree

1 file changed

+40
-5
lines changed

1 file changed

+40
-5
lines changed

15_Troubleshooting/jmap.md

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,39 +51,74 @@ When no option is used, the jmap command prints shared object mappings. For each
5151

5252
Dumps the Java heap in hprof binary format to filename. The live suboption is optional, but when specified, only the active objects in the heap are dumped. To browse the heap dump, you can use the jhat(1) command to read the generated file.
5353

54+
将Java堆以二进制格式hprof转储到文件中。`live` 子选项是可选的,如果指定该选项, 则只会导出堆内存中的存活对象。要查看堆转储, 可以使用 `jhat` 命令来读取生成的文件。
55+
56+
> 示例: `jmap -dump:live,format=b,file=/usr/local/6578_160613.hprof 6578`
57+
58+
5459
#### -finalizerinfo
5560

5661
Prints information about objects that are awaiting finalization.
5762

63+
输出等待终结(awaiting finalization)的对象信息。
64+
65+
66+
> 示例: `jmap -finalizerinfo 6578`
67+
5868
#### -heap
5969

6070
Prints a heap summary of the garbage collection used, the head configuration, and generation-wise heap usage. In addition, the number and size of interned Strings are printed.
6171

72+
输出垃圾收集使用的堆内存汇总信息,包括 head 配置和各个分代(generation-wise)的堆使用情况。此外,也会输出内部化字符串(interned Strings)的数量和大小。
73+
74+
> 示例: `jmap -heap 6578`
75+
76+
6277
#### -histo[:live]
6378

6479
Prints a histogram of the heap. For each Java class, the number of objects, memory size in bytes, and the fully qualified class names are printed. The JVM internal class names are printed with an asterisk (*) prefix. If the live suboption is specified, then only active objects are counted.
6580

81+
82+
输出堆内存的直方图统计信息。会输出每个Java类的实例数量,占用内存大小(字节),以及完全限定类名。JVM内部类名会带有一个星号(*)前缀。如果指定 `live` 子选项, 则只会统计存活对象(JVM会先触发gc,再进行统计)。
83+
84+
85+
> 示例: `jmap -histo:live 6578 > histo_6578.log`
86+
87+
88+
6689
#### -clstats
6790

6891
Prints class loader wise statistics of Java heap. For each class loader, its name, how active it is, address, parent class loader, and the number and size of classes it has loaded are printed.
6992

93+
输出以类加载器为维度识别的Java堆统计信息。对每个类加载器(class loader), 名字,活跃状态,地址, 父加载器, 加载类的数量和大小都会打印出来。
94+
95+
> JDK7 不提供支持.
96+
97+
> 示例: `jmap -clstats 6578`
98+
7099
#### -F
71100

72101
Force. Use this option with the jmap -dump or jmap -histo option when the pid does not respond. The live suboption is not supported in this mode.
73102

103+
强制模式。 在使用 `jmap -dump` or `jmap -histo` 选项时,如果 pid 不响应,则可以使用此参数。 注意: `live`子选项不支持此模式。
104+
74105
#### -h
75106

76-
Prints a help message.
107+
输出帮助信息(help message).
77108

78109
#### -help
79110

80-
Prints a help message.
111+
输出帮助信息(help message).
112+
113+
#### -J<flag>
114+
115+
116+
通过此选项,指定用于 **运行jmap的Java虚拟机** 的参数。
81117

82-
#### -Jflag
118+
> 示例: `jmap -J-Xmx128m 6578`
83119
84-
Passes flag to the Java Virtual Machine where the jmap command is running.
85120

86-
### See Also
121+
### 另请参见
87122

88123
- jhat(1)
89124

0 commit comments

Comments
 (0)