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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

runaway thread in tomcat 4.0.3

Status
Not open for further replies.

jpsb

Programmer
Oct 21, 2002
1
US
We are seeing one thead eat memory and CPU time when putting our application under a heavy load. Configuration is win2000/tomcat4.0.1/Open SA (Apache with SSL). Using jdbc to connect to Oracle. Anyone seeing anything similar? Just one thread is out of control, trying to find tools that will allow us to determine what the thread is doing. Running tomcat as a service and having a difficult time getting -verbose to work. Any help/suggestion are welcome.


 
Likely, the application is keeping references to objects, such that the garbage collector never gets chance to clean up objects that are no longer in use.

One place to check that occurs to me. Are you executing the Statement.close() method as well as on the ResultSet object? Leaving the statement object hanging out there can eat up database resources too. (too many cursors)

In method, guarantee that close occurs something like following.
-----------------------------
Statement statement = null;
ResultSet result = null;

try{

// create and use statement


} catch ( SomeException e ) {

} finally {
if( statment != null ){
try{ statement.close(); } catch( Exception e ){}
}
if( result != null ){
try{ result.close(); } catch( Exception e ){}
}
}


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top