Questions tagged [heap-dump]

A heap dump is a snapshot of the memory of a Java process.

A heap dump is a snapshot of the memory of a Java process.

The snapshot contains information about the Java objects and classes in the heap at the moment the snapshot is triggered. Because there are different formats for persisting this data, there might be some differences in the information provided. Typically, a full garbage collection is triggered before the heap dump is written, so the dump contains information about the remaining objects in the heap.

All Objects: Class, fields, primitive values, and references.

All Classes: Class loader, name, super class, and static fields.

Garbage collection roots: Objects defined to be reachable by the JVM.

Thread Stacks and Local Variables: Call-stacks of threads at the moment of the snapshot, and information about local objects on a frame by frame basis.

A heap dump does not contain allocation information, therefore you cannot work out what created the objects or where the objects were created.

Source

485 questions
3
votes
1 answer

Find out which class/instance holds a reference to an open file

I found a bug in logback that arises when it tries to delete a file that something else (such as an external process) holds a reference to. Usually, the issue goes away if a I close the external process, but I have also experienced that, instead of…
oligofren
  • 20,744
  • 16
  • 93
  • 180
3
votes
0 answers

How do I analyze a Java heap dump when local memory is less than the size of the dumped heap?

I have a really big hprof file about 21G which located on a remote server with 32G memory, and I would like to understand what happened in my program. However, on my local desktop I have only 8G memory so it's impossible to launch this file…
Nikita Duginets
  • 163
  • 1
  • 6
3
votes
2 answers

jmap supports ascii format for heap dump and binary dump format

I use jmap to dump heap memeory jmap -dump:format=b,file=test.hprof 22035 as far as I know, heap dump ascii format exists. but execute below command jmap -dump:format=a,file=test.hprof 22035 jmap Usage printed. ASCII format doesn't exist? And I…
uuidcode
  • 3,790
  • 3
  • 25
  • 30
3
votes
0 answers

Java: why is a heap-overflow NOT triggering a heap-dump?

I am trying to analyze an application that again and again dies with a heap out-of-memory. The application is started with: export JAVA_OPTS="-Xms256M -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/our_app_here/heapdump.dmp" Before the…
mmo
  • 3,897
  • 11
  • 42
  • 63
3
votes
1 answer

Can't get a Java heapdump from a docker container

My Java process is stuck and hogging a lot of CPU on the VM. I am trying to get to the root of the issue by getting a heapdump. This process is running in a docker container. I am getting into the container and running a jmap -F…
Deepak Gopal
  • 155
  • 4
  • 18
3
votes
1 answer

Can a java project with a runnable that runs at a fixed rate stop after a while? Mine keeps freezing after about 40 hours

After learning java on my own, i began a project for getting data from a website through api calls for a game called torn. There were a few little details i fixed thanks to some help, but the main issue i had is still not solved. after a day and a…
bookish303
  • 65
  • 5
3
votes
1 answer

How to extract JVM heap dump from core dump file?

I am trying to convert a Linux core dump of Java process to a heap dump file, suitable for analysing with Eclipse MAT. According to this blog post, adapted to the newer OpenJDK 12, I create a core dump and then run jhsdb jmap to convert the dump to…
Alex R.
  • 81
  • 1
  • 7
3
votes
0 answers

Java Memory leak with Play Framework and Logback

I have several Play framework applications running without problems. But here is one application, which has a memory leak and I have to restart the server every 24 hours, otherwise it would eat up all my memory. I created a heap dump and had it…
schube
  • 652
  • 5
  • 18
3
votes
2 answers

Analyze remote large heap dump

I'm having Java heap dump with about 70 GB in remote Debian machine, I can't analyse it in my local machine using MAT, although I can get an overview and suspicious leak reports as HTML pages, but they are brief and there are href for the objects…
Aladdin
  • 1,207
  • 2
  • 16
  • 26
3
votes
0 answers

How to break java heap dump into smaller parts?

I have a heap dump of 48 GB but only 10 GB of machine to debug that dump. Is there any way to break the heap dump into smaller files.
techagrammer
  • 1,291
  • 8
  • 19
3
votes
1 answer

Capturing heapdump for spring boot application

I am new to heap analysis. We have been using spring boot in our web application. Recently heap usage has become too high. To analyse heap dump with tools like Mat and JProfiler, I am downloading it using actuator as…
Joy
  • 4,197
  • 14
  • 61
  • 131
3
votes
1 answer

Should HeapDumpBeforeFullGC be used in production environment?

After full gc happens, we may want to know how it happens. Without heap dump, I think it is hard to do, but in production environment, we usually can't get it in time. So I want to use HeapDumpBeforeFullGC in my application when it runs online. My…
gatesking
  • 43
  • 5
3
votes
1 answer

Why is the size of the heap dump less than the size consumed by the JVM?

I have allocated a max value of 2048m for my Java web application. Due to some memory leak, the application has consumed nearly 2 GB of allocated memory. At this point, I have taken a memory dump using jvisualvm. During one instance the heap dump…
Anjan Baradwaj
  • 1,219
  • 5
  • 27
  • 54
3
votes
1 answer

Cannot access the value of a StringBuilder in a heap dump in VisualVM

I am willing to write the value of a large StringBuilder with index 827 to disk. I am trying to do that using the following OQL: map(heap.objects('java.lang.StringBuilder'), function(it, index) { if (index == 827.0) { var writer = new…
3
votes
1 answer

Analyze Heap usage in Java 8 Release 144 - feature removed? how to analyze heap then?

I am trying to use the heap and jstat commands to analyze heap usage by the different IDE and programs using Java, as my machine is incredibly slow. I have 16 GIG Ram, my min Heap is 252MB, my max Heap is 3,9 Gig. Now I want to know the heap usage…
Smart Geek
  • 37
  • 1
  • 4