Questions tagged [jmap]

A Hotspot JVM command-line utility that prints memory-related statistics for a running JVM or core file.

jmap is a command-line utility that serves as a tool for troubleshooting various memory-related issues in a Java Virtual Machine (JVM). jmap is distributed as a part of Oracle's Hotspot JVM, and so it can be used only for the Hotspot JVM.

jmap usually prints memory-related statistics for a running JVM or core file. Typical uses of jmap are :

  • jmap -histo <jvm-pid> - which prints class histogram of the instances present in the heap
  • jmap -heap <jvm-pid> - which prints a heap summary

A full list of command line options is available here.

163 questions
133
votes
12 answers

How do you Force Garbage Collection from the Shell?

So I am looking at a heap with jmap on a remote box and I want to force garbage collection on it. How do you do this without popping into jvisualvm or jconsole and friends? I know you shouldn't be in the practice of forcing garbage collection -- you…
eyberg
  • 3,160
  • 5
  • 27
  • 43
77
votes
8 answers

How can I analyze a heap dump in IntelliJ? (memory leak)

I have generated a heap dump from my java application which has been running for some days with the jmap tool -> this results in a large binary heap dump file. How can I perform memory analysis of this heap dump within IntellIJ IDEA? I know that…
vikingsteve
  • 38,481
  • 23
  • 112
  • 156
66
votes
8 answers

How to analyse the heap dump using jmap in java

I am creating heap dump using below command: jmap -dump:file=DumpFile.txt I have opened the generated file - DumpFile.txt but it is not in readable format. So please let me know how to analyze the data in the generated file.
Chaitanya
  • 15,403
  • 35
  • 96
  • 137
43
votes
1 answer

What are these objects in the jmap histogram?

I'm using jmap to get a histogram of the heap. I'm not sure what the objects are that are referred to as "[C", "[S", "[I" and "[B". Anyone know? $ jmap -histo 3299 num #instances #bytes class…
Chris Steinbach
  • 108
  • 1
  • 8
  • 22
40
votes
4 answers

What do those strange class names in a java heap dump mean?

I'm trying to track down a memory leak in a java process, using jmap and jhat. Every time I do this I see those weird notation for specific object types, like [S for string arrays and [C for Character arrays. I never remember what means what, and…
itsadok
  • 28,822
  • 30
  • 126
  • 171
34
votes
1 answer

Does jmap force garbage collection when the live option is used?

I've been experimenting with jmap -histo and jmap -dump today When run in this sequence jmap -dump:format=b,file=heap.1 [pid] jmap -dump:live,format=b,file=heap.2 [pid] jmap -dump:format=b,file=heap.3 [pid] heap.3 resembles heap.2 more than heap.1.…
VoiceOfUnreason
  • 52,766
  • 5
  • 49
  • 91
27
votes
5 answers

Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: cannot open binary file

When I use jmap to get the heap info about a process, I got error like that: $jmap -heap process_id Attaching to process ID process_id, please wait... Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: cannot open…
infraio
  • 271
  • 1
  • 3
  • 4
23
votes
2 answers

Why is my Java heap dump size much smaller than used memory?

Problem We are trying to find the culprit of a big memory leak in our web application. We have pretty limited experience with finding a memory leak, but we found out how to make a java heap dump using jmap and analyze it in Eclipse MAT. However,…
Thermometer
  • 2,567
  • 3
  • 20
  • 41
20
votes
3 answers

Is a JVM stopped while executing jmap?

Does my java application continue running while jmap is taking its memory dump?
StefanoS
  • 531
  • 2
  • 6
  • 16
19
votes
3 answers

Core dump taken with gcore, jmap conversion to hprof file format fails with Error message

We recently had one of our JVM's crash, leaving behind a core dump file produced by the gcore command. We want to have a look at the contents of the file and find out exactly what caused the crash. Using the jmap command you are supposed to be able…
Jon
  • 3,510
  • 6
  • 27
  • 32
17
votes
2 answers

Exception when taking a heapdump using JMAP

I get the following exception when i take a heapdump using jmap -F -dump:format=b,file=/tmp/heapdump/before.hprof 10737 Attaching to process ID 10737, please wait... Exception in thread "main" java.lang.reflect.InvocationTargetException at…
Priyanka
  • 191
  • 1
  • 2
  • 6
15
votes
1 answer

How to interpret the output from "jmap -permstat"?

I'm trying to troubleshoot a permgen leak, and wanted to ask you folks for your opinions on how to interpret the output from jmap -permstat. Let's say that I have a jmap -permstat report, like this: class_loader classes bytes …
Michael
  • 377
  • 1
  • 3
  • 12
14
votes
3 answers

'Shared Object Memory' vs 'Heap Memory' - Java

What is difference between 'Shared Object Memory' and 'Heap Memory' in Java. Is it like 'Shared Object Memory' is superset of 'Heap Memory'? The source of this question is documentation of jmap. It provides different options to Print 'Shared Object…
Sandeep Jindal
  • 14,510
  • 18
  • 83
  • 121
14
votes
2 answers

What is the meaning of "From Space" and "To Space" shown in jmap?

I understand the difference between new gen / old gen /perm gen, but I don't know what "To Space" and "From Space" are. I am seeing my "From Space" hitting 99.8% used while the "To Space" always seems to stay at 0% used.
juananneother
  • 155
  • 1
  • 1
  • 5
12
votes
3 answers

Want to confirm heap size that tomcat is using

I'm on ubuntu, and I need to confirm the heap size setting is being used by tomcat. How can I do that? I tried jmap but that doesn't seem to be on the server, can I download it individually somehow?
codecompleting
  • 9,251
  • 13
  • 61
  • 102
1
2 3
10 11