Skip to content

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireBean() causes ClassLoader leak [SPR-8956] #13596

Closed
@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions