tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hawkins, Keith (Keith)" <kphawk...@avaya.com>
Subject RE: Known Memory clean-up issues?
Date Thu, 29 Nov 2001 19:15:01 GMT
Randy,

Thanks for the reply. 

I checked my servlet code.  It only allocates local variables within the
request methods.  So the JVM should be cleaning them up but it isn't.
If I let my test run long enough, I can cause an OutOfMemory exception
to be thrown by Tomcat.

Any harm in forcing garbage collection to run?

-Keith


-----Original Message-----
From: Randy Layman [mailto:randy.layman@aswethink.com]
Sent: Thursday, November 29, 2001 1:20 PM
To: Tomcat Users List
Subject: RE: Known Memory clean-up issues?



	Tomcat doesn't free any memory related to servlets.  It creates
them
as needed (either at startup if loadonstartup is specified or on first
access) and then holds onto them for as long as it wants.  There is no
requirement as to when the servlet goes out of memory since it can use
the
same instance for hundreds of requests.  If I had to guess, you are
hanging
onto memory that you don't need any more, planning on the instance going
out
of scope.  This is generally bad since a single instance can be used to
handle multiple requests.

	The other possible thing that you are seeing is that the JVM
doesn't
give its memory back to the OS right away.  This varies by JVM, but all
of
them hang onto the memory for a while, just in case they will need it
again.

	Randy


> -----Original Message-----
> From: Hawkins, Keith (Keith) [mailto:kphawkins@avaya.com]
> Sent: Thursday, November 29, 2001 1:51 PM
> To: tomcat-user
> Subject: Known Memory clean-up issues?
> 
> 
> 
> Are there any known issues with Tomcat not freeing up memory properly?
> 
> My test of a repeated access to a servlet results in an ever 
> increasing
> memory size for
> the Tomcat process.   This is bad.
> 
> Thanks,
> Keith
> 
> 
> 

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message