Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Dec 22, 2011 · 1 comment
Assignees
Labels
type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Dec 22, 2011

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

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

As of 3.2, we're not caching PropertyDescriptors for external bean instances passed into autowireBean calls anymore now, which should address this issue.

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants