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
{{ message }}
Repository navigation
ProxyFactory memory leak using cglib [SPR-3620] #8302
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.
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.
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).
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)
Activity
spring-projects-issues commentedon Jun 25, 2007
Andy Piper commented
Memory reference picture
spring-projects-issues commentedon Jun 25, 2007
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.
spring-projects-issues commentedon Jun 25, 2007
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
spring-projects-issues commentedon Jun 25, 2007
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.
spring-projects-issues commentedon Jun 25, 2007
Andy Piper commented
Candidate fix
spring-projects-issues commentedon Jun 26, 2007
Andy Piper commented
This is confirmed to fix at least one leak.
spring-projects-issues commentedon Jun 27, 2007
Andy Piper commented
Updated patch. I found another leak.
spring-projects-issues commentedon Jul 1, 2007
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
spring-projects-issues commentedon Nov 9, 2007
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