Forrest logo
back to the jmap tool

jmap:tldr:8f459

jmap: Print heap summary information.
$ jmap -heap ${filename-jar} ${java_pid}
try on your machine

The command "jmap -heap ${filename-jar} ${java_pid}" is used to get the heap memory usage statistics of a Java process.

Here's an explanation of the components in the command:

  • "jmap" is a Java Memory Map tool that is bundled with the Java Development Kit (JDK). It is used to generate memory-related information about Java processes, including heap memory usage statistics.

  • "-heap" is an option provided by the "jmap" tool that specifies the type of memory information to retrieve. In this case, it retrieves the heap memory usage.

  • "${filename-jar}" is a placeholder for the filename or path of the Java JAR file. JAR (Java ARchive) is a package file format used to distribute Java applications.

  • "${java_pid}" is a placeholder for the process ID (PID) of the Java process for which you want to get the heap memory usage statistics. The PID uniquely identifies a running process on the operating system.

By running this command with the appropriate values for "${filename-jar}" and "${java_pid}", you can obtain the heap memory usage statistics for the specified Java process.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the jmap tool