Skip to content

ProxyFactory memory leak using cglib [SPR-3620] #8302

Closed

Description

@spring-projects-issues

Andy Piper opened SPR-3620 and commented

We are seeing a memory leak in ProxyFactory when using cglib. I will attach a picture of the references.


Affects: 2.0.5

Attachments:

Issue Links:

Activity

  1. spring-projects-issues commented on Jun 25, 2007

    @spring-projects-issues
    CollaboratorAuthor

    Andy Piper commented

    Memory reference picture

  2. spring-projects-issues commented on Jun 25, 2007

    @spring-projects-issues
    CollaboratorAuthor

    Andy Piper commented

    I think that the bug is in ProxyCallbackFilter. cglib maintains a hard reference to this in the key and so the value doesn't go away. I suspect by making the fixedInterceptorMap and advised fields weak this may cure the problem.

  3. spring-projects-issues commented on Jun 25, 2007

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    This might be a general memory leak problem with CGLIB, I'm afraid. If we make Spring's fields weakly referenced there, the CGLIB class itself will probably still stay around in memory. Of course the leak would show less effect then... so that might already help.

    Juergen

  4. spring-projects-issues commented on Jun 25, 2007

    @spring-projects-issues
    CollaboratorAuthor

    Andy Piper commented

    I'm not so sure. cglib correctly uses a WeakHashMap, with Spring fixed things might be ok. I'll attach the candidate fix that I am testing.

  5. spring-projects-issues commented on Jun 25, 2007

    @spring-projects-issues
    CollaboratorAuthor

    Andy Piper commented

    Candidate fix

  6. spring-projects-issues commented on Jun 26, 2007

    @spring-projects-issues
    CollaboratorAuthor

    Andy Piper commented

    This is confirmed to fix at least one leak.

  7. spring-projects-issues commented on Jun 27, 2007

    @spring-projects-issues
    CollaboratorAuthor

    Andy Piper commented

    Updated patch. I found another leak.

  8. spring-projects-issues commented on Jul 1, 2007

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    I have fixed this in CVS HEAD (for 2.1 M3) and mbranch-2-0 (for 2.0.7). This should be available in the next 2.1 M3 as well as 2.0.7 snapshots (tonight / tomorrow).

    Juergen

  9. spring-projects-issues commented on Nov 9, 2007

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    Andy, could you please re-test a current 2.5 RC2 / 2.0.8 snapshot with respect to this leak? I had to revise Cglib2AopProxy again since the fixes that you suggested here unfortunately caused a side effect with the reuse of CGLIB proxy classes... (see #8684)

    Thanks in advance,

    Juergen

  10. added
    type: bug
    in: core
    on Jan 11, 2019
  11. added this to the 2.0.7 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: coretype: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions