It's not a secret anymore!
The moose likes Performance and the fly likes does java 7 support -XX:+HeapDumpOnCtrlBreak Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "does java 7 support -XX:+HeapDumpOnCtrlBreak" Watch "does java 7 support -XX:+HeapDumpOnCtrlBreak" New topic

does java 7 support -XX:+HeapDumpOnCtrlBreak

Andy Werden

Joined: Nov 21, 2011
Posts: 3
Need to get a heap dump from a running app (tomcat) on JDK 1.702. Kill -3 does trigger some info to catalina.out but does not produce heap dump. Added -XX:+HeapDumpOnCtrlBreak and got

Unrecognized VM option 'HeapDumpOnCtrlBreak'

What's the trick?
Deepak Bala

Joined: Feb 24, 2006
Posts: 6662

Welcome to code ranch Andy

The -XX options are developer options and are subject to change between versions without any notice. It could have been dropped.

Application servers like JBOSS and Weblogic provide options to obtain thread dumps. You can try those servers if that is an option. Else you should be able to use JMX beans and JConsole to get the thread dumps. Someone has spent time writing a java class that pokes these beans -

I have not used these myself, but they may help you.

SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Andy Werden

Joined: Nov 21, 2011
Posts: 3
Still looking for a way to force a heap dump

JVM (tomcat) is running behind a firewall; unable to get Jconsole to connect

I agree. Here's the link:
subject: does java 7 support -XX:+HeapDumpOnCtrlBreak
It's not a secret anymore!