You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "VanIngen, Erik (FIPS)" <Er...@fao.org> on 2011/09/16 09:09:23 UTC

Test runs fine in Eclpse with 256m, breaks with Maven

Good morning Mavens!

Running a unittest configured with Xmx256M  in Eclipse runs fine. 

Running the same test with Maven on the prompt with set MAVEN_OPTS="-Xmx1024m"  results in a  Caused by: java.lang.OutOfMemoryError: Java heap space

What could be the reason that running the test on the prompt results in a Java Heap Space problem (while in Eclipse it runs fine)? 

My configuration is Maven 3.0.3, Java jdk1.6.0_16. 

Thanks for commenting,
Erik



Re: [ExternalEmail] Re: Test runs fine in Eclpse with 256m, breaks with Maven

Posted by Ben Caradoc-Davies <Be...@csiro.au>.
And the reason it might run fine in Eclipse is because you might have 
put -Xmx in your Eclipse JRE default JVM arguments (in Preferences). In 
any case, the JVM is invoked with a different classpath by Eclipse.

On 16/09/11 15:59, Ben Caradoc-Davies wrote:
> MAVEN_OPTS only affects Maven itself, not the new JVM instance it starts
> (by default) to run unit tests for each module. For a full-featured
> example of how to increase the heap of the JVM used for tests (a new one
> is created for each module), see the maven-surefire-plugin settings in
> the GeoTools root pom:
> http://svn.osgeo.org/geotools/trunk/pom.xml
>
> In a nutshell, you need to set your -Xmx option in
> plugins/plugin/configuration/argLine in your pom.
>
> Kind regards,
> Ben.
>
> On 16/09/11 15:09, VanIngen, Erik (FIPS) wrote:
>> Good morning Mavens!
>>
>> Running a unittest configured with Xmx256M  in Eclipse runs fine.
>>
>> Running the same test with Maven on the prompt with set MAVEN_OPTS="-Xmx1024m"  results in a  Caused by: java.lang.OutOfMemoryError: Java heap space
>>
>> What could be the reason that running the test on the prompt results in a Java Heap Space problem (while in Eclipse it runs fine)?
>>
>> My configuration is Maven 3.0.3, Java jdk1.6.0_16.
>>
>> Thanks for commenting,
>> Erik
>>
>>
>

-- 
Ben Caradoc-Davies <Be...@csiro.au>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Test runs fine in Eclpse with 256m, breaks with Maven

Posted by Ben Caradoc-Davies <Be...@csiro.au>.
MAVEN_OPTS only affects Maven itself, not the new JVM instance it starts 
(by default) to run unit tests for each module. For a full-featured 
example of how to increase the heap of the JVM used for tests (a new one 
is created for each module), see the maven-surefire-plugin settings in 
the GeoTools root pom:
http://svn.osgeo.org/geotools/trunk/pom.xml

In a nutshell, you need to set your -Xmx option in 
plugins/plugin/configuration/argLine in your pom.

Kind regards,
Ben.

On 16/09/11 15:09, VanIngen, Erik (FIPS) wrote:
> Good morning Mavens!
>
> Running a unittest configured with Xmx256M  in Eclipse runs fine.
>
> Running the same test with Maven on the prompt with set MAVEN_OPTS="-Xmx1024m"  results in a  Caused by: java.lang.OutOfMemoryError: Java heap space
>
> What could be the reason that running the test on the prompt results in a Java Heap Space problem (while in Eclipse it runs fine)?
>
> My configuration is Maven 3.0.3, Java jdk1.6.0_16.
>
> Thanks for commenting,
> Erik
>
>

-- 
Ben Caradoc-Davies <Be...@csiro.au>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Test runs fine in Eclpse with 256m, breaks with Maven

Posted by Anders Hammar <an...@hammar.net>.
How are you executing in Eclipse?
How are you executing from CLI?

/Anders

On Fri, Sep 16, 2011 at 09:09, VanIngen, Erik (FIPS)
<Er...@fao.org> wrote:
> Good morning Mavens!
>
> Running a unittest configured with Xmx256M  in Eclipse runs fine.
>
> Running the same test with Maven on the prompt with set MAVEN_OPTS="-Xmx1024m"  results in a  Caused by: java.lang.OutOfMemoryError: Java heap space
>
> What could be the reason that running the test on the prompt results in a Java Heap Space problem (while in Eclipse it runs fine)?
>
> My configuration is Maven 3.0.3, Java jdk1.6.0_16.
>
> Thanks for commenting,
> Erik
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org