[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: ClassLoader leak through TimedCachePolicy.resolutionTime
War undeployment as well as session invalidation should be flushing the cache. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135746#4135746 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135746 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: ClassLoader leak through TimedCachePolicy.resolutionTime
I tested with this patch to TimedCachePolicy. Yay, undeploy now works! | --- TimedCachePolicy.java | +++ TimedCachePolicy.java | @@ -77,7 +77,17 @@ public class TimedCachePolicy |public Object getValue(); | } | | - protected static Timer resolutionTimer = new Timer(true); | + protected static Timer resolutionTimer; | + static { | + ClassLoader cl = Thread.currentThread().getContextClassLoader(); | + try { | + Thread.currentThread().setContextClassLoader( | + TimedCachePolicy.class.getClassLoader()); | + resolutionTimer = new Timer(true); | + } finally { | + Thread.currentThread().setContextClassLoader(cl); | + } | + } | | /** The map of cached TimedEntry objects. */ | protected Map entryMap; | @@ -223,6 +233,8 @@ public class TimedCachePolicy | entry = (TimedEntry) value; |} |entry.init(now); | + if (! entry.isCurrent(now)) | + return; |entryMap.put(key, entry); | } | /** Remove the entry associated with key and call destroy on the entry | View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134234#4134234 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134234 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: ClassLoader leak through TimedCachePolicy.resolutionTime
There is another, perhaps theoretical leak possibility JBoss authentication cache implemented using TimedCachePolicy. This is because entries in TimedCachePolicy are not purged from the cache until they are fetched from the cache, and are then noticed as expired. The leak occurs when: 1. I login to web application using some credentials. 2. This information is entered in the authentication cache. The login credentials involve a LoginContext object that has reference to the web app ClassLoader. 3. I undeploy. 4. I never ever again login using the same credentials. When same credentials are not used, they will not be fetched from auth cache, therefore never seen as expired and never purged: the ClassLoader is leaked through the stuff entered in the cache. This can be worked around by flushing the cache. I guess JBAS-4752 sort of solves this. However, I think the cache should be purged also when web application is undeployed. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134192#4134192 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134192 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: ClassLoader leak through TimedCachePolicy.resolutionTime
Forgot to say: JBoss 4.2.1.GA, JDK 1.6.0_04. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134173#4134173 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134173 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user