[GRADLE-448] Gradle test fails with JDK 1.6.0_01 on Windows Created: 15/Apr/09  Updated: 04/Jan/13  Resolved: 15/Apr/09

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 0.6

Type: Bug
Reporter: Steve Appling Assignee: Hans Dockter
Resolution: Fixed Votes: 0

Attachments: Text File testmemory.patch    

 Description   

When running gradlew test on the current main trunk branch (as of rev 1351) I get the following:

 [ant:junit] Could not create the Java virtual machine.
java.io.FileNotFoundException: C:\OpenSource\gradle\gradle-trunk\junitvmwatcher1
597336873.properties (The system cannot find the file specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
   ...

This is because of the memory requirements of the jvm when testing. It will work for my configuration if the MaxPermSize is reduced to 128m.

I have included a patch to build.gradle to change this, but haven't tested this under a *nix OS.

BTW, requiring Xmx=1g and MaxPermSize=256m seem huge to me for the size of this project. This seems to indicate that something else is wrong with memory consumption, but at least this patch can get things working until the underlying memory issue could be addressed.

I understand that groovy will naturally be a permgen hog because every closure creates a new class which uses up permgen space. Since the test VM is only forked once (for speed), these will accumulate. Perhaps we need some other option, like Fork the VM for every 100 tests.



 Comments   
Comment by Hans Dockter [ 15/Apr/09 ]

The Grails project is also using multiple test groups (one group ~ one fork). They said that this has speed up there test execution (although in our case speed is not a pain point). With the planned features for 0.7 it will be easy and convenient to set up such test groups.

Comment by Steve Appling [ 15/Apr/09 ]

That sounds like a great plan for 0.7, but can someone make the build.gradle change to get things working until then?

Comment by Hans Dockter [ 15/Apr/09 ]

I have applied the patch. BTW: The current '-Xmx1g' setting is not the result of a lot of experimentation. We had out of memory problems so I have set it to a high enough value to get rid of them. -Xmx512M might be good enough.

Generated at Wed Jun 30 11:30:22 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.