@Async with cglib based proxy causes memory leak in permgen [SPR-11276] #15900
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Lukasz Rozek opened SPR-11276 and commented
running mvn clean package && mvn exec:exec -PpermLeak
against repro project that can be found here
https://github.com/lrozek/spring-leak
or https://github.com/lrozek/spring-leak/archive/master.zip
or git clone https://github.com/lrozek/spring-leak.git
causes java.lang.OutOfMemoryError: PermGen space in 1693 iteration
The stacktrace isn't logged, I guess the reason for that is insufficient memory to load classes that are needed to log it
Following logs are before OOME is thrown
As you can notice, every iteration (when application context is created from scratch) loads following classes:
where the two first classes aren't unloaded and cause memory leak in perm gen
This can be seen in iteration 1691 when Full GC occurs and following classes are unloaded:
...
In attached screenshot you can notice how memory leaks in perm while application contexts are created / closed
!perm leak.png!
Affects: 3.2.6, 4.0 GA
Reference URL: https://github.com/lrozek/spring-leak
Attachments:
Issue Links:
@Async
with cglib based proxy causes memory leak in heapReferenced from: commits be2d915, 0de307b
Backported to: 3.2.7
The text was updated successfully, but these errors were encountered: