tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <>
Subject Re: JAR files still locked after Context.stop()
Date Tue, 27 Apr 2010 17:45:11 GMT
2010/4/27 Jamie <>:
> I've check them out in YourKit profiler thoroughly. All threads in the main
> web application are exiting cleanly.  Is there is a way to call the
> WebAppClassloader to unload a particular JAR file?

JAR file, as well as any opened file, is an OS resource. Just GC() is
not enough.

1. You need to be sure that all streams obtained from it were properly
closed during lifetime of your application.
2. Usually there is caching with JAR URLs in JRE, but
JreMemoryLeakPreventionListener sets the default url caching option
for that to false (see its sources for details).
3. There might be timeouts in the OS. So you may need to add some
waiting. (Do not know why, whether it notifies some other applications
e.g. a/v software, or that are file system timeouts, or OS caches).

4. You may try renaming the old jar file. That might work.
5. You may try undeploy + redeploy of the application.

6. The "context" that you are calling stop() and start() is the right
object, i.e. it is an instance of StandarrdContext?

Best regards,
Konstantin Kolinko

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

View raw message