Java-Monitor Forum  

Go Back   Java-Monitor Forum > Java Application Server Administration > Java Administration

Reply
 
Thread Tools Search this Thread Display Modes
Programmatically dumping the Java heap
Old
  (#1)
kjkoster
Forum Operator
 
Status: Offline
Posts: 758
Join Date: Jul 2008
Default Programmatically dumping the Java heap - 05-02-2010, 20:18

Dear All,

Here is a neat snip of code to programmatically create a heap dump from a JVM. This is useful if you want to trigger a heap dump at precisely the right place in your code, or if creating a heap dump from an external program is impractical.

http://swik.net/openjdk/Java+Attribu...a+applications

Basically, the code retrieves the Sun-specific HotSpot JMX bean and calls the heap dump method on that mbean. Simple and powerful.

Kees Jan
   
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com