This question is follow up for this question http://stackoverflow.com/questions/20490105/gradleworkermain-outofmemoryerror I have module with 282 tests - working with inmemory db, CRUD operations. H2 and HSQL give the practically equal results in memory consumptions. If I use netbeans RCP ant task for testing this module I see 540MB max memory consumptions. I couldn’t take profiler snapshot as I see ant task use JUnitRunner for each test class. That why I can’t catch this JVM in profiler. Next picture is system memory consumption for ant junit task https://dl.dropboxusercontent.com/u/8384811/Misc/ant-unit-test.jpg
If I use gradle test task for the same module I may get different exceptions for not enough memory reason like this http://pastebin.com/ndYj1gr4 and JVM crush like this http://pastebin.com/5pRRxMHC (4GB Xmx is not enough). If I’m lucky and close all programs on my machine with 8GB RAM I may see the next picture during gradle junit testing for the same module. https://dl.dropboxusercontent.com/u/8384811/Misc/gradle-unit-tests.jpg
So how I can set the gradle test task running JUnitRunner separately against the test class for all module instead off one JUnitRunner for whole test classes in modules. Or can you suggest me another way for decreasing memory consumptions.
The second question. Could you explain difference in network history for gradle vs ant unit test tasks? I swear that I don’t downloading anything during test running.