You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
As of 3.2, we're not caching PropertyDescriptors for external bean instances passed into autowireBean calls anymore now, which should address this issue.
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:
Referenced from: commits e1d11ec
The text was updated successfully, but these errors were encountered: