tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <>
Subject RE: Java.lang.out.of.memory not clearly....
Date Mon, 30 Jan 2012 16:35:20 GMT
> From: David kerber [] 
> Subject: Re: Java.lang.out.of.memory not clearly....

> Java can have memory leaks just as easily as C can

Not really; leaks in C are much easier to create.

> if the app is standalone, it will release them when the app 
> closes and the JRE shuts down.

That's true for C and any other language as well.

> if the app is running under tomcat, the JRE never shuts down 
> since tomcat is using it.  That means the JRE can not free up 
> memory that your app has left allocated, as it would be able 
> to in a standalone app.
Although that's true, it's not really relevant.  Memory leaks in Java occur when some program
logic hangs onto references it no longer needs (e.g., in a static HashMap).  These objects
won't be discarded by the garbage collector since they are reachable - the program logic failed
to remove them from the structure when it was done with them.  Restarting the webapp will
release these objects.

The more subtle leaks that occur when reloading a webapp are typically due to references to
the webapp's classes or classloader being held by some component outside of the webapp, such
as a shared logger.  Those are the ones that require restart of Tomcat.

Regardless, we still have no real evidence of what's going on at Luciano's site.

 - Chuck

for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message