tomcat-users mailing list archives

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

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?


-----Original Message-----
From: Randy Layman []
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
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
same instance for hundreds of requests.  If I had to guess, you are
onto memory that you don't need any more, planning on the instance going
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
give its memory back to the OS right away.  This varies by JVM, but all
them hang onto the memory for a while, just in case they will need it


> -----Original Message-----
> From: Hawkins, Keith (Keith) []
> 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:   <>
For additional commands: <>
Troubles with the list: <>

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message