[jira] [Commented] (DELTASPIKE-519) ClassLoader leak in ClassDeactivationUtils

2020-05-18 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/DELTASPIKE-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17110347#comment-17110347
 ] 

ASF subversion and git services commented on DELTASPIKE-519:


Commit d826c9686ca85a79b4e8f52beda4ab78b38bb680 in deltaspike's branch 
refs/heads/master from Mark Struberg
[ https://gitbox.apache.org/repos/asf?p=deltaspike.git;h=d826c96 ]

DELTASPIKE-519 fix potential ClassLoader leak


> ClassLoader leak in ClassDeactivationUtils
> --
>
> Key: DELTASPIKE-519
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-519
> Project: DeltaSpike
>  Issue Type: Bug
>  Components: Core
>Affects Versions: 0.5
>Reporter: Moritz Bechler
>Assignee: Mark Struberg
>Priority: Critical
>
> ClassDeactivationUtils statically holds two maps (classDeactivatorMap, 
> activationStatusCache) one having a classloader as key and the other a class. 
> These entries are never removed resulting in leaks of the TCCL or the 
> classloaders of Deactivatable classes if they do not equal the classloader 
> loading deltaspike.
> Suggested fix:
> {code}
> /**
>  * This Map holds the ClassLoader as first level to make it possible to 
> have different configurations per 
>  * WebApplication in an EAR or other Multi-ClassLoader scenario.
>  * 
>  * The Map then contains a List of {@link ClassDeactivator}s in order of 
> their configured ordinal.
>  */
> private static Map> 
> classDeactivatorMap
> = Collections.synchronizedMap(new WeakHashMap List>());
> /**
>  * Cache for the result. It won't contain many classes but it might be 
> accessed frequently.
>  * Valid entries are only true or false. If an entry isn't available or 
> null, it gets calculated.
>  */
> private static Map, Boolean> 
> activationStatusCache
> = Collections.synchronizedMap(new WeakHashMap Deactivatable>, Boolean>());
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (DELTASPIKE-519) ClassLoader leak in ClassDeactivationUtils

2014-02-07 Thread Romain Manni-Bucau (JIRA)

[ 
https://issues.apache.org/jira/browse/DELTASPIKE-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13894475#comment-13894475
 ] 

Romain Manni-Bucau commented on DELTASPIKE-519:
---

I think we have it for BeanManagerProvider too. We spoke about having a map 
store in the classloader (using Unsafe), it could do the trick and would avoid 
the need to track classloaders

 ClassLoader leak in ClassDeactivationUtils
 --

 Key: DELTASPIKE-519
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-519
 Project: DeltaSpike
  Issue Type: Bug
  Components: Core
Affects Versions: 0.5
Reporter: Moritz Bechler
Priority: Critical

 ClassDeactivationUtils statically holds two maps (classDeactivatorMap, 
 activationStatusCache) one having a classloader as key and the other a class. 
 These entries are never removed resulting in leaks of the TCCL or the 
 classloaders of Deactivatable classes if they do not equal the classloader 
 loading deltaspike.
 Suggested fix:
 {code}
 /**
  * This Map holds the ClassLoader as first level to make it possible to 
 have different configurations per 
  * WebApplication in an EAR or other Multi-ClassLoader scenario.
  * 
  * The Map then contains a List of {@link ClassDeactivator}s in order of 
 their configured ordinal.
  */
 private static MapClassLoader, ListClassDeactivator 
 classDeactivatorMap
 = Collections.synchronizedMap(new WeakHashMapClassLoader, 
 ListClassDeactivator());
 /**
  * Cache for the result. It won't contain many classes but it might be 
 accessed frequently.
  * Valid entries are only true or false. If an entry isn't available or 
 null, it gets calculated.
  */
 private static MapClass? extends Deactivatable, Boolean 
 activationStatusCache
 = Collections.synchronizedMap(new WeakHashMapClass? extends 
 Deactivatable, Boolean());
 {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Commented] (DELTASPIKE-519) ClassLoader leak in ClassDeactivationUtils

2014-02-07 Thread Romain Manni-Bucau (JIRA)

[ 
https://issues.apache.org/jira/browse/DELTASPIKE-519?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13894508#comment-13894508
 ] 

Romain Manni-Bucau commented on DELTASPIKE-519:
---

excepted startup loader and runtime/shutdown loader can be different

 ClassLoader leak in ClassDeactivationUtils
 --

 Key: DELTASPIKE-519
 URL: https://issues.apache.org/jira/browse/DELTASPIKE-519
 Project: DeltaSpike
  Issue Type: Bug
  Components: Core
Affects Versions: 0.5
Reporter: Moritz Bechler
Priority: Critical

 ClassDeactivationUtils statically holds two maps (classDeactivatorMap, 
 activationStatusCache) one having a classloader as key and the other a class. 
 These entries are never removed resulting in leaks of the TCCL or the 
 classloaders of Deactivatable classes if they do not equal the classloader 
 loading deltaspike.
 Suggested fix:
 {code}
 /**
  * This Map holds the ClassLoader as first level to make it possible to 
 have different configurations per 
  * WebApplication in an EAR or other Multi-ClassLoader scenario.
  * 
  * The Map then contains a List of {@link ClassDeactivator}s in order of 
 their configured ordinal.
  */
 private static MapClassLoader, ListClassDeactivator 
 classDeactivatorMap
 = Collections.synchronizedMap(new WeakHashMapClassLoader, 
 ListClassDeactivator());
 /**
  * Cache for the result. It won't contain many classes but it might be 
 accessed frequently.
  * Valid entries are only true or false. If an entry isn't available or 
 null, it gets calculated.
  */
 private static MapClass? extends Deactivatable, Boolean 
 activationStatusCache
 = Collections.synchronizedMap(new WeakHashMapClass? extends 
 Deactivatable, Boolean());
 {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)