LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

jmap

prints memory-related statistics for Java processes

TLDR

Print class loader statistics
$ jmap -clstats [pid]
copy
Dump heap to file
$ jmap -dump:format=b,file=[heap.hprof] [pid]
copy
Dump live objects only
$ jmap -dump:live,format=b,file=[heap.hprof] [pid]
copy
Histogram of objects
$ jmap -histo [pid]
copy
Live objects histogram
$ jmap -histo:live [pid]
copy

SYNOPSIS

jmap [options] pid

DESCRIPTION

jmap prints memory-related statistics for Java processes. It generates heap dumps, object histograms, and class loader statistics.The tool is essential for memory analysis and leak detection. Heap dumps can be analyzed with tools like Eclipse MAT or VisualVM.

PARAMETERS

PID

Target Java process ID.
-clstats pid
Print class loader statistics of the Java heap.
-finalizerinfo pid
Print information on objects awaiting finalization.
-histo[:live]
Print histogram of the Java object heap. With :live, counts only live objects.
-dump:options
Dump the Java heap. Sub-options:
:live
Only live objects.
:format=b
Binary hprof format.
:file=FILE
Output file path.

CAVEATS

Part of JDK. This command is experimental and unsupported; it may not be available in future JDK releases. May pause the application during heap dump. Large heaps create large dump files.

HISTORY

jmap has been part of the JDK since Java 5, providing memory analysis capabilities for running Java processes.

SEE ALSO

jhat(1), jstack(1), jinfo(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid