Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java "Out of memory" error when using Tomcat 4.1

Status
Not open for further replies.

marlowp

Programmer
Apr 24, 2005
1
CA
I am developing a web application for text searching and retrieval of information from an Oracle 9i database.

I am using JDK 1.4.2_08 with Tomcat 4.1.31 on Windows 2000.

Currently I am using the default settings for the heap size which if I'm not mistaken is 64 MB, and yes I realize that I will have to optimize the heap/garbage collection.

Each search tends to use 10+ MB of memory. The garbage collection of the JVM should be handling the cleanup, however I notice that the tomcat.exe process continuously increases in size (which I assume corresponds to an increase in the heap size) until it reaches the maximum of 64 MB.

However, after installing OptimizeIt to examine the contents of the heap, the garbage collector does appear to be cleaning up my objects - so there should be no memory leak.

Does anyone have any explanation as to why Tomcat is running out of memory? I'm at a loss to explain it. I know I can increase the heap size - but I just don't want to end up postponing the problem instead of solving it.
 
When Tomcat processes a request, it spawns a custom thread to deal with it. When the request is done, this thread object is added to a pool to save on initialization of objects to handle subsequest requests. I expect what you are seeing is memory being used by this pool, and then when you get a few heavy queries, it blows the heap assigned to the JVM.

Just increase your heap sizes, and I expect you'll be OK.

--------------------------------------------------
Free Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top