On 09/02/2011, at 6:54 PM, ouar29 wrote:
>
> Hello,
>
> I recently moved to Gradle and i really appreciate it.
> But i'm stuck with an issue: i have a test that requires the JVM to be set
> with -Xmx1024m (if not, it fails with a out of memory error).
>
> I see in the documentation that it is possible to set the option via
> GRADLE_OPTS or in the Gradle.bat. I did that but my test fails anyway-> out
> of memory error; in Eclipse, everything works fine.
GRADLE_OPTS affects the jvm used to run Gradle. The tests run in a separate
jvm. You can configure the test task to change the args used for this jvm. For
example:
test {
maxHeapSize = '1024m'
}
>
> I wrote a simple test to illustrate the issue
>
> @Test
> public void test(){
>
> int MAX = 50000000;
> List<Integer> bigList = new ArrayList<Integer>(MAX);
>
> for(int i=0; i<MAX; i++){
> bigList.add(new Integer(5));
> }
> }
>
> What can i do ? Am i missing something ?
> I'd really appreciate help.
>
> Regards,
> Nicolas
> --
> View this message in context:
> http://gradle.1045684.n5.nabble.com/Running-test-requiring-1024m-memory-tp3377171p3377171.html
> Sent from the gradle-user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz