jmap monitoring tool of the JVM

Reference blog: https://www.jianshu.com/p/a4ad53179df3

 

 

jmap (Memory Map for Java) command is used to generate heap dump snapshot (commonly referred to as heapdump or dump file). jmap role is not just to obtain the dump file, it can finalize the query execution queue, Java heap and details of permanent generation,
such as space usage, which is currently used for the collection and so on. And jinfo command, like, jmap there are many features in Windows platforms are limited,
in addition to generate dump files for viewing and -dump options for each instance of the class, occupancy statistics -histo options are all operating systems provided, the other option can only be used under Linux / Solaris.

 

Parameters:
the Option: Option parameter.
pid: process ID need to print configuration information.
executable: generating a core dump of the Java executable.
core: core files need to print configuration information.
server-id optional unique id, if multiple debug servers running on the same remote host, this option parameter identifies the server.
IP address or host name of the remote server IP or hostname of remote debugging server.

no option: the memory image to view process information, similar to the Solaris pmap command.
heap: Java heap show details
histo [: live]: Displays statistics objects in a heap
clstats: class loader print information
finalizerinfo: displaying an object queue for execution method Finalizer finalizer thread Queue-F.
the dump: <the dump-Options> : Health heap dump snapshots
F:.. when -dump not responding, using -dump or -histo parameters in this mode, live child parameter is invalid
help: print help

 

jmap print shared objects with no options parameter mapping, it will print the target virtual machine to load the starting address of each shared object, mapping the size and path of the shared object files full name. This is quite similar to the Solaris pmap tool.

 

Show details Java heap, a heap of print summary information, including the use of GC algorithm, stack configuration information, and memory usage of each memory area

 

 

 

 

Jmap execute commands, parameters -dump, start the tomcat, with jmap command to generate the dump file, first find out first with jps -l tomcat process id, then execute the command: jmap -dump: live, format = b, file = / usr /loca/heap.bin 33201, we see in the bin directory to generate a heap dump file.

 

jmap -histo: live pid
Description: Displays statistics object on the heap, each of which comprises a Java class, the number of objects, memory size (unit: bytes), the fully qualified class name. Inside the virtual machine will print the class name with an '*' prefix. If you live sub-option is specified, only the object computing activities.

 

命令:jmap -clstats pid
描述:打印类加载器信息 ,-clstats是-permstat的替代方案,在JDK8之前,-permstat用来打印类加载器的数据
打印Java堆内存的永久保存区域的类加载器的智能统计信息。对于每个类加载器而言,它的名称、活跃度、地址、父类加载器、它所加载的类的数量和大小都会被打印。此外,包含的字符串数量和大小也会被打印。

 

 

Guess you like

Origin www.cnblogs.com/cheng21553516/p/11223615.html