This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Generate Heapdump on Demand

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not completely sure if this the right forum for this question. If not, please point me to the correct one.

My company is having an issue where a java app is encountering an OutOfMemory exception after about 8 hours of run time. After the intial load, it grows at a rate of about 100 megs per hour during core usage. During off hours, memory usage just plateaus. It should go down but does not...GC is pretty inneffective. The heap does not appear to be fragmented. This is a vendor application, so we are not able to look at the code. We've already engaged the vendor but are still running into some issues.

What we need to do is generate multiple heap dumps throughout the day before an OOM error is generated. I know that a kill -3 [pid] will do this, but that is only generating a javacore.txt file. I want the heapdump.phd file. How can this be generated on demand? I'm thinking that there is a command line option that I'm missing in my JAVA_OPTS.

IBM JDK 1.4.2
AIX 5.3
Tomcat 4.1.40 (don't think this makes a difference here)
 
Ryan Rank
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I found what I was looking for. this is the necessary launch script.

<PRE>
CLASSPATH=
JAVA_HOME=/usr/java14
CATALINA_HOME=/tomcat4
CATALINA_OPTS="-Xms###m -Xmx###m -verbose:gc -Xverbosegclog:/tomcat4/logs/GC.log -Xk22000 -Xp32768K,4096K -Xss256k -Xoss256k -Xcompactgc -Xgcpolicy:optthruput -Dsun.rmi.dgc.server.gcInterval=3600000 -Dsun.rmi.dgc.client.gcInterval=3600000 -Djava.awt.headless=true"
IBM_HEAPDUMP=TRUE
IBM_HEAPDUMPDIR="/dumpstore"
IBM_JAVACOREDIR="/dumpstore"

export CLASSPATH
export JAVA_HOME
export CATALINA_HOME
export CATALINA_OPTS
export IBM_HEAPDUMP
export IBM_HEAPDUMPDIR
export IBM_JAVACOREDIR

[Launch Tomcat]
</PRE>

That allows for a kill -3 to output the heapdump.phd file as well as the javacore.txt files to the location desired.

Hopefully those in need can get some use out of this.
 
Saloon Keeper
Posts: 25841
184
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought it was "kill -2", but whatever.

I spent an entire month on one of those - partly because each test took about 3 days to reach critical mass. Finally discovered that Oracle's "cache" wasn't technically a cache in that it had no discard mechanism; it kept everything. Forever.

And it was documented that it was supposed to do that. Just not in a place that you'd see it until you already pretty well knew it. Changing the connection options made the problem magically vanish.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic