tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Curwen" <gb_...@gb-im.com>
Subject RE: Memory leaks?
Date Fri, 05 Sep 2003 17:09:52 GMT
After about 15 emails, I'm gonna go back to the first:

> I seemed to have read that java/tomcat isn't 
> supposed to have memory leaks,

AND

> So where do I start looking for the problem?  
> If I forget to close Statements would that cause the 
> problem?

So first of all, Java has built-in memory management and garbage
collection, so comparing against a language like C++, it's MUCH harder
to cause a memory leak in a Java program, *but not impossible*. And up
to now we're focusing on JDBC.  Connection pools and whether or not your
driver strictly adheres to the JDBC standard are certainly one source of
memory leaks. But they're not the only ones possible. What sorts of
other activities are going on in your application?  Do you have other
3rd party libraries?  Libraries you've written yourself? Have these been
profiled and exercised to ensure they are not the ones leaking?

 
> -----Original Message-----
> From: Jim Lynch [mailto:jwl@sgi.com] 
> Sent: Friday, September 05, 2003 9:37 AM
> To: Tomcat Users List
> Subject: Re: Memory leaks?
> 
> 
> I'm most certain the connections are closed but there may be 
> a few dangling statements.  I'm using mysql jdbc.  Not using 
> pools since I never could get it working.  Making direct requests.  
> 
> Still getting a out of memory hit every couple of days so I 
> have to shutdown the server and start it up again.
> 
> THnak,s
> Jim.
> 
> "Shapira, Yoav" wrote:
> > 
> > Howdy,
> > You don't have to close a result set if you're closing the 
> statement 
> > right away and the result set is the only one associated with the 
> > statement... And in no case can closing the result set 
> explicitly hurt 
> > performance.
> > 
> > Yoav Shapira
> > Millennium ChemInformatics
> > 
> > >-----Original Message-----
> > >From: Greg Ward [mailto:gward-work@python.net]
> > >Sent: Thursday, September 04, 2003 10:05 AM
> > >To: Tomcat Users List; jwl@sgi.com
> > >Subject: Re: Memory leaks?
> > >
> > >On 03 September 2003, Jim Lynch said:
> > >> OK, that's probably what's going on.  I know I should close
> > Statements
> > >> and Connections and do normally but I'm fairly certain I've some 
> > >> out there dangling.  I didn't know you had to close ResultSets, 
> > >> however. Glad to know that.
> > >
> > >You don't have to close ResultSets -- check the JDBC docs:
> > >
> > >
> > 
> http://java.sun.com/j2se/1.4.2/docs/api/java/s>
ql/Statement.html#close(
> > )
> > >
> > >(Closing a Statement also closes any open ResultSets 
> associated with 
> > >that Statement.)
> > >
> > >        Greg
> > >
> > 
> >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: 
> tomcat-user-help@jakarta.apache.org
> > 
> > This e-mail, including any attachments, is a confidential business 
> > communication, and may contain information that is confidential, 
> > proprietary and/or privileged.  This e-mail is intended 
> only for the 
> > individual(s) to whom it is addressed, and may not be 
> saved, copied, 
> > printed, disclosed or used by anyone else.  If you are not the(an) 
> > intended recipient, please immediately delete this e-mail from your 
> > computer system and notify the sender.  Thank you.
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


Mime
View raw message