Closed
Description
carl chase opened SPR-8956 and commented
We are using the AbstractAutowireCapableBeanFactory.autowireBean() method to autowire beans instantiated from dynamically compiled Groovy classes.
AbstractAutowireCapableBeanFactory uses the Class object as a key in the filteredPropertyDescriptorsCache Map to cache PropertyDescriptors.
When we re-compile the Groovy class, and invoke autowireBean() on a newly created object, the old Class object remains in the cache.
Thus, the Class and its ClassLoader never get GC'd.
It only takes about 1200 of these cycles to consume our PermGen space.
Perhaps WeakHashMap would be a better choice for filteredPropertyDescriptorsCache.
Affects: 3.0.4
Issue Links:
- Performance regression for custom autowireBean calls with many properties [SPR-11875] #16494 Performance regression for custom autowireBean calls with many properties
Referenced from: commits e1d11ec