Skip to content

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

Closed

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

Activity

  1. spring-projects-issues commented on Nov 8, 2012

    @spring-projects-issues
    CollaboratorAuthor

    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

Metadata

Metadata

Assignees

Labels

type: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions