heap-dump

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

 ̄綄美尐妖づ 提交于 2019-11-30 08:58:15
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, with our application using 56/60GB memory, the heap dump is only 16GB in size and is even less in Eclipse MAT. Context Our server uses Wildfly 8.2.0 on Ubuntu 14.04 for our java application, whose process uses 95% of the available memory. When making the dump, our buffers/cache used space was at 56GB. We used the following command to create the dump:

How to get jmap histogram programmatically?

你。 提交于 2019-11-30 08:40:46
I would like to get the equivalent of the ouput of jmap -histo programmatically, from inside the monitored application. I see triggering a binary heap dump is possible through the HotSpot diagnostic bean, but I can't see how to get the histogram data. Is it possible ? It may be not the best example/code, but have a look at this (I think it's only working on Hotspot JVMs) 来源: https://stackoverflow.com/questions/9417038/how-to-get-jmap-histogram-programmatically

High memory usage when using Hibernate

时间秒杀一切 提交于 2019-11-30 04:03:08
I code a server side application with java run on linux server. I use hibernate to open session to database, use native sql to query it and always close this session by try, catch, finally. My server query DB using hibernate with very high frequency. I already define MaxHeapSize for it is 3000M but it usually use 2.7GB on RAM, it can decrease but slower than increase. Sometime it grow up to 3.6GB memory usage, more than my MaxHeapSize define when start. When memory used is 3.6GB, i try to dump it with -jmap command and got a heapdump with size of 1.3GB only. Im using eclipse MAT to analyse it,

How to convert a heap dump in android to eclipse format

亡梦爱人 提交于 2019-11-30 03:55:24
Im attempting to analyze a memory leak that has been driving me crazy for weeks, I found out about the eclipse MAT tool that helps you to figure out what is wrong, the problem is every single tutorial I have found says that I need to convert the format of the file from dalvik to HPROF format, however not one single tutorial I can find explains how to actually do it, instead I get vague things like this Now the file you will get does not conform to the "standard" Sun .hprof format but is written in Dalvik's own format and you need to convert it: hprof-conv heap-dump-tm-pid.hprof 4mat.hprof what

Using -XX:HeapDumpPath option but want to integrate the process id

余生颓废 提交于 2019-11-29 17:05:27
问题 When using -XX:+HeapDumpOnOutOfMemoryError the JVM will not overwrite the heap dump if there is already a dump file under the specified path. I want to be able to have multiple heap dumps in a non-default location, and was planning on using the pid in the heap dump path in order to allow that. However, when I tried to specify the argument like so: -XX:HeapDumpPath=some/heapdump/path/heapdump-%p.hprof And then created a heap dump, I got %p and not the actual pid in the file name. However, the

How do I produce a heap dump with only a JRE?

◇◆丶佛笑我妖孽 提交于 2019-11-29 13:21:43
问题 We have a JRE installed on our production environment, but not a JDK. The versions of the JRE and OS are below. [me@mymachine ~]$ java -version java version "1.6.0_45" Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode) [me@mymachine ~]$ uname -a Linux mymachine.mydomain.com 3.10.35-43.137.amzn1.x86_64 #1 SMP Wed Apr 2 09:36:59 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux It doesn’t appear as if the “jmap” tool is present anywhere on

Java heap dump error with jmap command : Premature EOF

試著忘記壹切 提交于 2019-11-29 13:17:40
I have encountered below exception during execution of below command jmap -dump:format=b,file=heap_dump.bin <process_id> output: Dumping heap to <file_name> Exception in thread "main" java.io.IOException: Premature EOF at sun.tools.attach.HotSpotVirtualMachine.readInt(HotSpotVirtualMachine.java:248) at sun.tools.attach.LinuxVirtualMachine.execute(LinuxVirtualMachine.java:199) at sun.tools.attach.HotSpotVirtualMachine.executeCommand(HotSpotVirtualMachine.java:217) at sun.tools.attach.HotSpotVirtualMachine.dumpHeap(HotSpotVirtualMachine.java:180) at sun.tools.jmap.JMap.dump(JMap.java:242) at sun

How to get jmap histogram programmatically?

∥☆過路亽.° 提交于 2019-11-29 12:14:19
问题 I would like to get the equivalent of the ouput of jmap -histo programmatically, from inside the monitored application. I see triggering a binary heap dump is possible through the HotSpot diagnostic bean, but I can't see how to get the histogram data. Is it possible ? 回答1: It may be not the best example/code, but have a look at this (I think it's only working on Hotspot JVMs) 来源: https://stackoverflow.com/questions/9417038/how-to-get-jmap-histogram-programmatically

Generate Java Heap Dump on uncaught Exception

本秂侑毒 提交于 2019-11-29 08:06:22
I try to generate a Heap Dump when a uncaught exception is fired. I tried using jmap, but because the process is finished when the exception happens this is not possible. Using a UncaughtExceptionHandler is no option either, because I only have the binaries of the programs that is executed. Can anyone help me? EDIT: It is important that the technique is available through a command line or similar, because I need to automated this. Using a GUI is no option Try to put your processing into a deamon thread. this way you can access it with memory analysis tools. JVisualVM is a JDK tool you can find

How to take a heap dump in windows with minimum downtime?

荒凉一梦 提交于 2019-11-29 02:40:42
I want to figure out why JVM heap usage on Elasticsearch node is staying consistently above 80%. In order to do this, I take a heap dump by running jmap.exe -heap:format=b 5348 (5348 is the Process ID). Then I can analyze the dump with VisualVM. The problem is that jmap pauses the JVM while taking the dump, so the node is basically offline for around 5 minutes. This article suggests a faster approach that relies on taking coredump with gdb on Linux. I already tried WinDbg, which created a core dump, but I couldn't use it in VisualVM. Is there a similar approach for Windows? How one can take