• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

OutOfMemoryError in a servlet

 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,
I have a servlet that gives me an OutOfMemoryError when the number of transactions inreases beyond a threshold (300 transactions for a Max Heap Size of 128MB, 1200 transactions for a Max Heap Size of 1024MB).
It seems that there is some object that keeps growing with each transaction. Is there some way to find (in Weblogic) what object(s) is/are growing as more and more transactions are made?
Any other suggestions on how to debug in this situation?
Warm regards,
Sharad Agarwal
 
Sharad Agarwal
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Folks,
I tried to get some idea using HAT (http://java.sun.com/people/billf/heap/index.html). But, the tool gives me a runtime error with the generated hprof file:
D:\hat\bin>java -cp hat.zip -mx100m hat.Main ../doc/dump.hprof
Started HTTP server on port 7000
Reading from ../doc/dump.hprof...
Dump file created Mon Mar 24 18:59:39 EST 2003
java.io.EOFException
at java.io.DataInputStream.readFully(DataInputStream.java:153)
at java.io.DataInputStream.readFully(DataInputStream.java:126)
at hat.parser.HprofReader.read(HprofReader.java:203)
at hat.parser.Reader.readFile(Reader.java:91)
at hat.Main.main(Main.java:135)
Any ideas?
Warm regards,
Sharad Agarwal
 
Sharad Agarwal
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,
I made some progress on the issue. To get the hprof dumps we need to do one of two things - either add doe=y to the -Xrunhprof: parameters (dump on exit) or hit Ctrl-Break (Windows) at the DOS prompt to cause dumping. Since I had not dumped the file properly, I got an EOFException.
Further, for jdk 1.3 and higher, we need to add the option -classic; otherwise the dump is in a different format and HAT is unable to read it (giving an IOException).
Hope this helps others facing similar problems. Warm regards,
Sharad Agarwal
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm trying to use HAT to debug a web application running locally on Tomcat, but am also receiving a java.io.EOFException. I tried entering the "-classic" parameter alongside the "-Xrunhprof" parameter, and I also tried using "doe=y". Neither seemed to help. I'm not sure about "doe=y", since I don't know what the exit would be for a web app., as opposed to a standalone application with a "main()" method. Does anyone have any ideas?

Thanks,

Matt
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
format=b appended to the java command makes the hprof file binary, which is required by HAT.
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can also try HPJMeter http://www.hp.com/products1/unix/java/hpjmeter/ instead of HAT. I think it reads all of the hprof formats.

Best Regards,
KArol Muszynski
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic