-
Bug
-
Resolution: Done
-
Major
-
7.1.0.CR1b
This is another Class Loader leak memory issue. When class are loaded into the properties map, they don't get unloaded at undeploy. This cause the whole application's class loader not being garbage collected and so will result in OutOfMemoryError: PermGen space after a few deployments.
The solution would be to call the purgeBeanClasses method at undeploy with each of the class loader of all sub-modules of the application.
For the moment, the work around I've done was to change
private static final ConcurrentHashMap<Class, BeanProperties> properties = new ConcurrentHashMap<Class, BeanProperties>(CACHE_SIZE);
to
private static final Map<Class<?>, SoftReference<BeanProperties>> properties = Collections.synchronizedMap(new WeakHashMap<Class<?>, SoftReference<BeanProperties>>(CACHE_SIZE));
But I'm not really sure if that's a good idea to replace the ConcurrentHashMap with a SynchronizedMap and I had to change
properties.putIfAbsent(baseClass, bps);
By
synchronized(properties) { if (!properties.containsKey(baseClass)) properties.put(baseClass, new SoftReference<BeanProperties>(bps)); }
- is related to
-
JBPAPP-6530 BaseClassLoader leaking memory after undeploy
- Resolved
- relates to
-
JBPAPP-6530 BaseClassLoader leaking memory after undeploy
- Resolved