Aug 31, 2010 12:28:39 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Aug 31, 2010 12:28:40 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [Poller SunPKCS11-Darwin] but has failed to stop it. This is very likely to create a memory leak.
Aug 31, 2010 12:28:40 PM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
It says SEVERE but is this really something I should be worried about?
Donald Winston wrote:Not by me. There's nothing I'm doing that would cause this. It's difficult to create a "memory leak" in Java.
I wish. I spent an entire month tracking down a memory leak several years back. Turned out an Oracle "cache" class was no such thing. By my definition at least, a cache includes an aging mechanism that limits how much data it contains. This particular "cache" was in fact a bottomless pit. Until the JVM ran out of memory about 4 days into a run.
More recently (yesterday!), I got a call for help from an old colleague because something in their webapp is leaking memory.
Occasionally, people even pay me to find that sort of stuff. Or they just schedule nightly reboots.
According to your log files, you are trying to shutdown Tomcat itself, and that particular thread did not shutdown in the time frame that Tomcat thought was reasonable given that it was shutting itself down.
If this were your own application, I would try to use the admin panel to remove that application from a Tomcat instance that is still running - see if the message occurs then. If it does, then you have a problem with your own application leaving threads running (which will cause both a memory leak and reduce the number of threads in the pool).
I think that particular thread is one that comes with Tomcat, and is used for cryptographic key storage. As such, it is not meant to be taken in/out of service. So the fact that it failed to shut down instantly the moment that Tomcat asked it to shut down is not necessarily a problem. In fact it may even be desirable: if there is some other application relying on PKCS11 that has not yet started to shutdown, and all of a sudden the service disappears, it is going to have some major error handling to do (or continue without encryption - eek).
It doesn't come with Tomcat, although with a name like that, it might come with the MacOS JVM.
I'm extremely sceptical, however, that it's "OK" for a thread to be tripping an alert like that. If it's a JVM thread, it should be getting its shutdown message only after Tomcat has terminated all the webapps and flushed out all the outstanding requests. Which would make it very unlikely that you'd get a Tomcat error that said "A web application appears to have started a thread " from the WebappClassLoader clearReferencesThreads method.
According to a stack dump someone posted over on one of Apple's support forums, this is a daemon thread. Since it's not part of Tomcat (or at least part of Tomcat 6), and all the messages are claiming it belongs to a webapp, that implies that the webapp didn't terminate the thread properly before the webapp itself indicated that it was done shutting down. This doesn't look like the type of process that should take long to terminate under normal conditions, so chances are that the offending webapp didn't try to terminate the thread at all.
I wouldn't worry too much about memory leaks here, unless the thread is saving up large encryption buffers for a rainy day or something.