[GRADLE-2217] ClassFileExtractionManager causes memory leak in Test task Created: 06/Apr/12 Updated: 04/Jan/13 Resolved: 04/May/12
|Reporter:||Peter Niederwieser||Assignee:||Luke Daley|
Each Test task seems to have its own TestFramework/TestFrameworkDetector/ClassFileExtractionManager. These objects are kept in memory even after the task has run, causing a memory leak. In a project with 800+ Test tasks, ClassFileExtractionManager retained 350MB heap in total and up to 12MB per instance at the time the OOME occurred. The workaround we used was to null out Test.testFramework in a doLast action.
|Comment by Luke Daley [ 10/Apr/12 ]|
I've had a quick look, some options in order of easiest to hardest (guessed):
1. Have the test task null out the testFramework object after execution
#2 will require some juggling to deal with API changes but it's not terrible. #3 is potentially attractive as it may offer a performance increase by not requiring test classes to be extracted from jars for each test execution