Daneel S. Yaitskov Daneel S. Yaitskov - 15 days ago 5
Linux Question

Jvm heapdump is not generated by signal

I noticed that jvm doesn't generated a heap dump by signal 3.
I tried jvm 1.8.60 and jvm 1.7.60 (ubuntu 14).
When jvm gets signals it prints thread dump to console but memory dump file doesn't appear.


java -XX:HeapDumpPath=/tmp/xxx


Tracing java options confirms that it's all right.


bool PrintHeapAtSIGBREAK = true {product}

ccstr HeapDumpPath := /tmp/xxx {manageable}


What did I miss?

jmap works though.

kill and jvm run under the same user.
jar is a hello world app.

Answer

JVM is not supposed to generate a heap dump on SIGQUIT (kill -3).

PrintHeapAtSIGBREAK means different thing. It prints heap layout summary, e.g.

Heap
 PSYoungGen      total 75264K, used 3870K [0x000000076c600000, 0x0000000771a00000, 0x00000007c0000000)
  eden space 64512K, 6% used [0x000000076c600000,0x000000076c9c7b68,0x0000000770500000)
  from space 10752K, 0% used [0x0000000770f80000,0x0000000770f80000,0x0000000771a00000)
  to   space 10752K, 0% used [0x0000000770500000,0x0000000770500000,0x0000000770f80000)
 ParOldGen       total 172032K, used 0K [0x00000006c5200000, 0x00000006cfa00000, 0x000000076c600000)
  object space 172032K, 0% used [0x00000006c5200000,0x00000006c5200000,0x00000006cfa00000)
 Metaspace       used 2471K, capacity 4486K, committed 4864K, reserved 1056768K
  class space    used 267K, capacity 386K, committed 512K, reserved 1048576K

jmap is the right way to generate a heap dump.

Comments