File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Massive array of ints Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Massive array of ints" Watch "Massive array of ints" New topic

Massive array of ints

Randy Yarger

Joined: Feb 13, 2007
Posts: 6
I'm debugging an application running on Tomcat 7 that is proving to be extremely unstable. I see three of the four typical causes for site failure regularly: runaway CPU consumption, deadlocked threads and OutOfMemory conditions (about the only thing I don't see is DAO connection issues).

In the heapdump for crashes that happen due to OutOfMemory, I consistently see that a large portion of the heap (80%+) is taken up by a single object - an array of ints that is referenced (apparently) directly from org.apache.tomcat.util.threads.TaskThread. I've seen more than half billion elements in this array, causing it to take up gigabytes of heap space. When viewing the heap summary through YourKit, this object is listed as unreachable.

The application itself doesn't use int arrays to store anything, at least explicitly.

Any ideas where these may be coming from? I seem to remember reading that Expression Language elements can cause problems in newer versions of Tomcat but I can find little reference to this on Google. This intrigues me because when the servers die due to thread deadlocks, there are almost always thread blocked in the middle of EL evaluation. Could the EL engine be sharing space somehow and getting tangled up?

Any ideas would be appreciated!

-Randy Yarger
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17423

Ya got me, podner.

There's nothing I know of that should be causing this. I'd be interested in finding out what's going on myself.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Massive array of ints
It's not a secret anymore!