troubleshooting Question

Tomcat OutOfMemory Error

Avatar of howesd
howesd asked on
JavaJava EE
12 Comments1 Solution1024 ViewsLast Modified:
I'm getting the following message in my tomcat_startup.log file:

Exception in thread "CompileThread0" java.lang.OutOfMemoryError: requested 32744
Possible causes:
    - not enough swap space left, or
    - kernel parameter MAXDSIZ is very small.

My web service has been running for a period of time and processed about 3000 messages by the time I get this message. I'm assuming I've got a leak somewhere, but what I don't understand is the messages which are coming from the garbage collector. Here's a sample, leading up to the point of failure.

[GC 168797K->115810K(253376K), 1.1021105 secs]
[Full GC 186338K->34784K(253376K), 2.1465015 secs]
[GC 105312K->51055K(253376K), 0.6689243 secs]
[GC 121583K->65479K(253376K), 0.9771493 secs]
[GC 136007K->81954K(253376K), 1.0667930 secs]
[GC 152482K->98688K(253376K), 1.0712523 secs]
[GC 169216K->114567K(253376K), 1.0470047 secs]
[Full GC 185095K->43383K(253376K), 2.1180948 secs]
[GC 113911K->59531K(253376K), 0.6476948 secs]
[GC 130059K->75146K(253376K), 1.0221978 secs]
[GC 145674K->90490K(253376K), 1.0183663 secs]
[GC 160993K->107275K(253376K), 1.0650010 secs]
[Full GC 177729K->44734K(253376K), 2.0310564 secs]
[GC 115262K->61962K(253376K), 0.6891112 secs]
[GC 132452K->79260K(253376K), 1.0994987 secs]
[GC 149788K->95811K(253376K), 1.0748164 secs]
[GC 166339K->112025K(253376K), 1.0772419 secs]
[Full GC 182553K->42117K(253376K), 1.9592741 secs]
[GC 112645K->60682K(253376K), 0.7600968 secs]
[GC 131210K->78550K(253376K), 1.1069211 secs]
[GC 149078K->94732K(253376K), 1.0519028 secs]
[GC 165260K->110771K(253376K), 1.0621776 secs]
[Full GC 181295K->36480K(253376K), 2.0753039 secs]
[GC 107008K->57139K(253376K), 0.8464745 secs]
[GC 127667K->70099K(253376K), 0.8504655 secs]
[GC 140627K->87441K(253376K), 1.0064823 secs]
[GC 157969K->104765K(253376K), 1.0709205 secs]
[Full GC 175251K->41448K(253376K), 1.9769365 secs]
[GC 111976K->61407K(253376K), 0.8121462 secs]
[GC 131935K->75689K(253376K), 0.9745546 secs]
[GC 146217K->91304K(253376K), 1.0441760 secs]
[GC 161832K->106179K(253376K), 1.0302689 secs]
[Full GC 176707K->43718K(253376K), 1.9495609 secs]
[GC 114246K->62067K(253376K), 0.7376315 secs]
[GC 132595K->78028K(253376K), 1.0644368 secs]
[GC 148516K->95724K(253376K), 1.1181359 secs]
[GC 166252K->111861K(253376K), 1.0734530 secs]
[Full GC 182389K->45398K(253376K), 2.0283743 secs]
[GC 115904K->65256K(253376K), 0.7902363 secs]
[GC 135784K->82259K(253376K), 1.0666038 secs]
[GC 152787K->100415K(253376K), 1.1243421 secs]
[GC 170943K->116604K(253376K), 1.0400142 secs]
[Full GC 187132K->35908K(253376K), 2.0993267 secs]
[GC 106424K->55904K(253376K), 0.8692005 secs]
[GC 126432K->75385K(253376K), 1.1466020 secs]
[GC 145913K->91073K(253376K), 1.0708800 secs]
[GC 161599K->108128K(253376K), 1.1014872 secs]
[Full GC 178656K->48272K(253376K), 2.1499973 secs]
[GC 118800K->68236K(253376K), 0.8255374 secs]

and here's my JVM options ( TOMCAT_OPTS )
-verbose:gc -Xeprof:times=quick -Xeprof:file=/tmp/ -
XdoCloseWithReadPending -Xms256m -Xmx256m -Xmn86m

If I'm reading the GC trace correctly, the last GC run compressed the heap down to about 68 meg and my total heap size is about 250 meg. Given the fact that the trace up to this point has reached a maximum size of about 170 meg, and the mix of work which is going through the system has not changed, I don't understand how I can have run out of memory - I should have about 190 meg to go at and, as far as I can see, only about 10 messages went through between the last GC run and the failure.

I'm on HP-UX using Tomcat 3.1.1 and Java 1.3

Any help would be much appreciated - my live date is approaching rapidly!


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros