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
12
votes
2 answers

Find current heap size with jmap

I would like to find out what is the total heap size that is in use at a certain time by a Java process and I have to use jmap. The output of jmap -heap gives me something like this: Attaching to process ID 2899, please wait... Debugger…
fmoga
  • 233
  • 1
  • 4
  • 13
11
votes
5 answers

Java : Get heap dump without jmap or without hanging the application

In few circumstance, our application is using around 12 GB of memory. We tried to get the heap dump using jmap utility. Since the application is using some GB of memory it causes the application to stop responding and causes problem in…
Arun
  • 327
  • 1
  • 3
  • 12
11
votes
2 answers

Java Heap dump permissions

The java heap dumps generated in a Linux Machine (and most probably Unix machines as well) have restricted access. The heap can only be read by the owner of the process (ACL mask is set to 600). I understand that this is for security reasons.…
Abhilash Koneri
  • 121
  • 1
  • 4
10
votes
2 answers

Locating code that is filling PermGen with dead Groovy code

We have had our glassfish instance go down every two weeks for a while with a java.lang.OutOfMemoryError: PermGen space. I increased the PermGen space to 512MB and startet dumping memory usage with jstat -gc. After two weeks I came up with the…
oligofren
  • 20,744
  • 16
  • 93
  • 180
10
votes
1 answer

why there is difference in Heap dump size generated by jmap and jcmd?

I am trying to take heap dump using below 2 commands jcmd $pid GC.heap_dump /tmp/filename.dump jmap -dump:format=b,file=/tmp/filename.dump $pid jcmd produces file size of ~300M and jmap produces file size of ~1.4G. why these are different sizes,…
Vipin
  • 4,851
  • 3
  • 35
  • 65
10
votes
3 answers

Extracting information from a a java core dump with jmap(1.5)

Long story short, some coworkers are running a pretty old setup(oc4j jdk1.5.6 in x86_64) with an application which happens to be mission critical. They recently have tried to deploy a new version of the application, but as soon as they do the java…
Samuel
  • 2,430
  • 2
  • 19
  • 21
10
votes
2 answers

Java memory leak - jmap doesn't show the classes but jstat does

I troubleshoot a weird memory leak. It's specific to Java8, not happening on 7u79. I don't have access to Java code. I know exactly which user action causes a leak, I know the leak is about the classes (not the heap) and the offending classes are…
kubanczyk
  • 5,184
  • 1
  • 41
  • 52
10
votes
1 answer

Garbage Collector First and JMap EOF bug

We are working over our client's production server heap to detect and solve memory leaks. For this we are using jmap periodically to collect the necessary information. But last week we couldn't take the dump, because it triggered a EOF error and…
vkrausser
  • 393
  • 1
  • 3
  • 17
9
votes
1 answer

jmap crashes with "can not get class data for"

Had a Java core dump; running jmap with: /usr/java/jdk1.8.0_25/bin/jmap -dump:format=b,file=dump.hprof /usr/bin/java core.31497 Gives the following exception: Attaching to core core.31497 from executable /usr/bin/java, please wait... ... JVM…
Gregory Golberg
  • 363
  • 5
  • 15
7
votes
5 answers

Why GC doesn't collect my objects?

I have a java program which keeps calling java.util.zip to compress/decompress data. It runs out of memory within a few seconds. I had a memory dump with jmap and I'm viewing it with jhat. Finalizer summary shows Total instances pending…
woodings
  • 7,503
  • 5
  • 34
  • 52
6
votes
1 answer

what are "live" objects in java heap? (heap dump with jmap)

jmap help shows: ... -dump: to dump java heap in hprof binary format dump-options: live dump only live objects; if not specified, all objects in the…
auntyellow
  • 2,423
  • 2
  • 20
  • 47
6
votes
4 answers

Is there a way to do a live heap dump with ibm-jdk for linux?

I know that it's possible to dump heap when an OutOfMemoryException is occuring on this JVM but is it possible to ask a live dump with tools like jmap or jconsole?
Opty
  • 504
  • 5
  • 10
6
votes
3 answers

JMap alternative available?

When I ran below jmap command: jmap -histo 14104 I am able to see very nice output of my objects, there instances, bytes used. num #instances #bytes class name ---------------------------------------------- 1: 1308333 …
Nikhil Joshi
  • 817
  • 2
  • 12
  • 34
6
votes
0 answers

Convert from non-binary to binary format for java memory dump

Using the tool jmap, you can create a memory dump in two formats: Binary format: jmap -dump:format=b,file=binary_dump.dat or Other format: jmap -dump:file=other_format_dump.dat I've read a number of places that only the binary format…
GreenGiant
  • 4,930
  • 1
  • 46
  • 76
6
votes
1 answer

How to use java memory histogram "jmap"

We have java streaming server running in production and it requires ~10GB of RAM for operation so we have 32GB installed. Memory is gradually increased until limit is reached and out-of-memory exceptions pop up. I have trouble pinpointing what…
Alex
  • 2,837
  • 5
  • 25
  • 27
1
2
3
10 11