|
From: Rodrigo K. <ku...@re...> - 2004-05-27 21:42:18
|
Hi. I tried to produce some sort of classloading hack to minimize this problem but I found that it's nether Spring's or Tomcat's fault. The problem can be caused by simple use of j2se APIs. All your patches won't really reduce the problem as no class can be collected before it's classloader, the spec says that and the ClassLoader implementation from Sun enforce. Most of the times the OOM during hotdeploy is caused by not having enouth memory for the class semi-space, or whatever it's name is, and not for regular objects. Some API's have caching and thus break class unloading, an example is java.beans.Introspector, you must call Introspector.flushCaches() during context destroy on Sun JVM, and this is a bug as it should use weak references. I believe the solution is to look for these classes and never use any non-standard classes the container makes available. Anyway, it will only work if your container provides classloading that is not broken like some AS do. |