Re: Reduce memory-usage of maven 2
Hi Martijn On Sun, 2006-09-10 at 16:09 +0200, Martijn Dashorst wrote: > Probably the defaults for your jvm are too low. You can (read: should > be able to) increase the memory available for your Java runtime > environment by setting the following (assuming you use bash as a > shell): > > export JAVA_OPTS=-Xmx512m > > This should give you enough memory for maven to run in. Thank you for your answer. I tried setting it like this, but this did not work, maybe because of this here: [WARNING] Failed to initialize environment variable resolver. Skipping environment substitution in settings. So i changed it directly in the file /usr/local/maven/bin/mvn, by changing exec "$JAVACMD" \ $MAVEN_OPTS \ -classpath "${M2_HOME}"/core/boot/classworlds-*.jar \ "-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \ "-Dmaven.home=${M2_HOME}" \ ${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS to exec "$JAVACMD" -Xmx512m \ $MAVEN_OPTS \ -classpath "${M2_HOME}"/core/boot/classworlds-*.jar \ "-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \ "-Dmaven.home=${M2_HOME}" \ ${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS Now mvn is starting, but it really seems like I don't have enough memory: [EMAIL PROTECTED]:~/modules/sudokusolver$ mvn package [INFO] Scanning for projects... [INFO] [INFO] Building Sudoku Solver [INFO]task-segment: [package] [INFO] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Nothing to compile - all classes are up to date [INFO] [resources:testResources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:testCompile] [INFO] Nothing to compile - all classes are up to date [INFO] [surefire:test] [INFO] Surefire report directory: /home/autobuild/modules/sudokusolver/target/surefire-reports [INFO] [ERROR] FATAL ERROR [INFO] [INFO] unable to create new native thread [INFO] [INFO] Trace java.lang.OutOfMemoryError: unable to create new native thread So I tried it with -Xmx32m as my provider told me to do so, but then I get: [INFO] [surefire:test] [INFO] Surefire report directory: /home/autobuild/modules/sudokusolver/target/surefire-reports Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. [INFO] [ERROR] BUILD FAILURE [INFO] I think the surefire-report does not get the -Xmx32m argument? Do you have another hint for me how I could fix this? Thank you Elias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reduce memory-usage of maven 2
Hi Dan On Sun, 2006-09-10 at 09:20 -0700, dan tran wrote: > surefire plugin by default spins off a new jvm, you can configure surefire > plugin's "forkMode" to none > > http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html Thank you very much for your help - it is working now :) Elias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reduce memory-usage of maven 2
surefire plugin by default spins off a new jvm, you can configure surefire plugin's "forkMode" to none http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html -D On 9/10/06, Elias Gerber <[EMAIL PROTECTED]> wrote: Hi Martijn On Sun, 2006-09-10 at 16:09 +0200, Martijn Dashorst wrote: > Probably the defaults for your jvm are too low. You can (read: should > be able to) increase the memory available for your Java runtime > environment by setting the following (assuming you use bash as a > shell): > > export JAVA_OPTS=-Xmx512m > > This should give you enough memory for maven to run in. Thank you for your answer. I tried setting it like this, but this did not work, maybe because of this here: [WARNING] Failed to initialize environment variable resolver. Skipping environment substitution in settings. So i changed it directly in the file /usr/local/maven/bin/mvn, by changing exec "$JAVACMD" \ $MAVEN_OPTS \ -classpath "${M2_HOME}"/core/boot/classworlds-*.jar \ "-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \ "-Dmaven.home=${M2_HOME}" \ ${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS to exec "$JAVACMD" -Xmx512m \ $MAVEN_OPTS \ -classpath "${M2_HOME}"/core/boot/classworlds-*.jar \ "-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \ "-Dmaven.home=${M2_HOME}" \ ${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS Now mvn is starting, but it really seems like I don't have enough memory: [EMAIL PROTECTED]:~/modules/sudokusolver$ mvn package [INFO] Scanning for projects... [INFO] [INFO] Building Sudoku Solver [INFO]task-segment: [package] [INFO] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Nothing to compile - all classes are up to date [INFO] [resources:testResources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:testCompile] [INFO] Nothing to compile - all classes are up to date [INFO] [surefire:test] [INFO] Surefire report directory: /home/autobuild/modules/sudokusolver/target/surefire-reports [INFO] [ERROR] FATAL ERROR [INFO] [INFO] unable to create new native thread [INFO] [INFO] Trace java.lang.OutOfMemoryError: unable to create new native thread So I tried it with -Xmx32m as my provider told me to do so, but then I get: [INFO] [surefire:test] [INFO] Surefire report directory: /home/autobuild/modules/sudokusolver/target/surefire-reports Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine. [INFO] [ERROR] BUILD FAILURE [INFO] I think the surefire-report does not get the -Xmx32m argument? Do you have another hint for me how I could fix this? Thank you Elias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reduce memory-usage of maven 2
Probably the defaults for your jvm are too low. You can (read: should be able to) increase the memory available for your Java runtime environment by setting the following (assuming you use bash as a shell): export JAVA_OPTS=-Xmx512m This should give you enough memory for maven to run in. Martijn On 9/10/06, Elias Gerber <[EMAIL PROTECTED]> wrote: Hello everyone! I am using Maven 2.0.4 for some of my (very small) projects. Now I installed maven on a virtuall root server I own, and I would like to use maven to do daily builds on that machine. But if I run 'mvn package' there, I get the following exception: java.io.IOException: java.io.IOException: Cannot allocate memory at java.lang.UNIXProcess.(UNIXProcess.java:148) (The full output is at the bottom of this E-Mail) Now my question: Is it possible to reduce memory-usage of mvn? Or can I not avoid it to buy (rent) some more RAM? Thank you for any help. Elias Gerber output of mvn package: [EMAIL PROTECTED]:~/modules/sudokusolver$ mvn package [WARNING] Failed to initialize environment variable resolver. Skipping environment substitution in settings. --- constituent[0]: file:/usr/local/maven-2.0.4/lib/maven-plugin-api-2.0.4.jar constituent[1]: file:/usr/local/maven-2.0.4/lib/wagon-file-1.0-alpha-7.jar constituent[2]: file:/usr/local/maven-2.0.4/lib/maven-artifact-manager-2.0.4.jar constituent[3]: file:/usr/local/maven-2.0.4/lib/maven-repository-metadata-2.0.4.jar constituent[4]: file:/usr/local/maven-2.0.4/lib/maven-artifact-2.0.4.jar constituent[5]: file:/usr/local/maven-2.0.4/lib/maven-core-2.0.4.jar constituent[6]: file:/usr/local/maven-2.0.4/lib/wagon-ssh-1.0-alpha-7.jar constituent[7]: file:/usr/local/maven-2.0.4/lib/maven-profile-2.0.4.jar constituent[8]: file:/usr/local/maven-2.0.4/lib/jsch-0.1.24.jar constituent[9]: file:/usr/local/maven-2.0.4/lib/maven-settings-2.0.4.jar constituent[10]: file:/usr/local/maven-2.0.4/lib/doxia-sink-api-1.0-alpha-7.jar constituent[11]: file:/usr/local/maven-2.0.4/lib/maven-model-2.0.4.jar constituent[12]: file:/usr/local/maven-2.0.4/lib/maven-plugin-descriptor-2.0.4.jar constituent[13]: file:/usr/local/maven-2.0.4/lib/maven-project-2.0.4.jar constituent[14]: file:/usr/local/maven-2.0.4/lib/maven-monitor-2.0.4.jar constituent[15]: file:/usr/local/maven-2.0.4/lib/wagon-http-lightweight-1.0-alpha-6.jar constituent[16]: file:/usr/local/maven-2.0.4/lib/maven-reporting-api-2.0.4.jar constituent[17]: file:/usr/local/maven-2.0.4/lib/commons-cli-1.0.jar constituent[18]: file:/usr/local/maven-2.0.4/lib/wagon-provider-api-1.0-alpha-6.jar constituent[19]: file:/usr/local/maven-2.0.4/lib/wagon-ssh-external-1.0-alpha-6.jar constituent[20]: file:/usr/local/maven-2.0.4/lib/maven-plugin-parameter-documenter-2.0.4.jar constituent[21]: file:/usr/local/maven-2.0.4/lib/plexus-interactivity-api-1.0-alpha-4.jar constituent[22]: file:/usr/local/maven-2.0.4/lib/maven-plugin-registry-2.0.4.jar constituent[23]: file:/usr/local/maven-2.0.4/lib/maven-error-diagnostics-2.0.4.jar --- java.io.IOException: java.io.IOException: Cannot allocate memory at java.lang.UNIXProcess.(UNIXProcess.java:148) at java.lang.ProcessImpl.start(ProcessImpl.java:65) at java.lang.ProcessBuilder.start(ProcessBuilder.java:451) at java.lang.Runtime.exec(Runtime.java:591) at java.lang.Runtime.exec(Runtime.java:429) at java.lang.Runtime.exec(Runtime.java:326) at org.codehaus.plexus.util.cli.CommandLineUtils.getSystemEnvVars(CommandLineUtils.java:177) at org.apache.maven.project.interpolation.RegexBasedModelInterpolator.(RegexBasedModelInterpolator.java:60) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at java.lang.Class.newInstance0(Class.java:350) at java.lang.Class.newInstance(Class.java:303) at org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:44) at org.codehaus.plexus.DefaultPlexusContainer.createComponentInstance(DefaultPlexusContainer.java:1464) at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:93) at org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92) at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331) at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:129) at org.codehaus.plexus.component.composition.Field
Reduce memory-usage of maven 2
Hello everyone! I am using Maven 2.0.4 for some of my (very small) projects. Now I installed maven on a virtuall root server I own, and I would like to use maven to do daily builds on that machine. But if I run 'mvn package' there, I get the following exception: java.io.IOException: java.io.IOException: Cannot allocate memory at java.lang.UNIXProcess.(UNIXProcess.java:148) (The full output is at the bottom of this E-Mail) Now my question: Is it possible to reduce memory-usage of mvn? Or can I not avoid it to buy (rent) some more RAM? Thank you for any help. Elias Gerber output of mvn package: [EMAIL PROTECTED]:~/modules/sudokusolver$ mvn package [WARNING] Failed to initialize environment variable resolver. Skipping environment substitution in settings. --- constituent[0]: file:/usr/local/maven-2.0.4/lib/maven-plugin-api-2.0.4.jar constituent[1]: file:/usr/local/maven-2.0.4/lib/wagon-file-1.0-alpha-7.jar constituent[2]: file:/usr/local/maven-2.0.4/lib/maven-artifact-manager-2.0.4.jar constituent[3]: file:/usr/local/maven-2.0.4/lib/maven-repository-metadata-2.0.4.jar constituent[4]: file:/usr/local/maven-2.0.4/lib/maven-artifact-2.0.4.jar constituent[5]: file:/usr/local/maven-2.0.4/lib/maven-core-2.0.4.jar constituent[6]: file:/usr/local/maven-2.0.4/lib/wagon-ssh-1.0-alpha-7.jar constituent[7]: file:/usr/local/maven-2.0.4/lib/maven-profile-2.0.4.jar constituent[8]: file:/usr/local/maven-2.0.4/lib/jsch-0.1.24.jar constituent[9]: file:/usr/local/maven-2.0.4/lib/maven-settings-2.0.4.jar constituent[10]: file:/usr/local/maven-2.0.4/lib/doxia-sink-api-1.0-alpha-7.jar constituent[11]: file:/usr/local/maven-2.0.4/lib/maven-model-2.0.4.jar constituent[12]: file:/usr/local/maven-2.0.4/lib/maven-plugin-descriptor-2.0.4.jar constituent[13]: file:/usr/local/maven-2.0.4/lib/maven-project-2.0.4.jar constituent[14]: file:/usr/local/maven-2.0.4/lib/maven-monitor-2.0.4.jar constituent[15]: file:/usr/local/maven-2.0.4/lib/wagon-http-lightweight-1.0-alpha-6.jar constituent[16]: file:/usr/local/maven-2.0.4/lib/maven-reporting-api-2.0.4.jar constituent[17]: file:/usr/local/maven-2.0.4/lib/commons-cli-1.0.jar constituent[18]: file:/usr/local/maven-2.0.4/lib/wagon-provider-api-1.0-alpha-6.jar constituent[19]: file:/usr/local/maven-2.0.4/lib/wagon-ssh-external-1.0-alpha-6.jar constituent[20]: file:/usr/local/maven-2.0.4/lib/maven-plugin-parameter-documenter-2.0.4.jar constituent[21]: file:/usr/local/maven-2.0.4/lib/plexus-interactivity-api-1.0-alpha-4.jar constituent[22]: file:/usr/local/maven-2.0.4/lib/maven-plugin-registry-2.0.4.jar constituent[23]: file:/usr/local/maven-2.0.4/lib/maven-error-diagnostics-2.0.4.jar --- java.io.IOException: java.io.IOException: Cannot allocate memory at java.lang.UNIXProcess.(UNIXProcess.java:148) at java.lang.ProcessImpl.start(ProcessImpl.java:65) at java.lang.ProcessBuilder.start(ProcessBuilder.java:451) at java.lang.Runtime.exec(Runtime.java:591) at java.lang.Runtime.exec(Runtime.java:429) at java.lang.Runtime.exec(Runtime.java:326) at org.codehaus.plexus.util.cli.CommandLineUtils.getSystemEnvVars(CommandLineUtils.java:177) at org.apache.maven.project.interpolation.RegexBasedModelInterpolator.(RegexBasedModelInterpolator.java:60) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at java.lang.Class.newInstance0(Class.java:350) at java.lang.Class.newInstance(Class.java:303) at org.codehaus.plexus.component.factory.java.JavaComponentFactory.newInstance(JavaComponentFactory.java:44) at org.codehaus.plexus.DefaultPlexusContainer.createComponentInstance(DefaultPlexusContainer.java:1464) at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:93) at org.codehaus.plexus.component.manager.ClassicSingletonComponentManager.getComponent(ClassicSingletonComponentManager.java:92) at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331) at org.codehaus.plexus.component.composition.FieldComponentComposer.assignRequirementToField(FieldComponentComposer.java:129) at org.codehaus.plexus.component.composition.FieldComponentComposer.assembleComponent(FieldComponentComposer.java:73) at org.codehaus.plexus.component.composition.DefaultComponentComposerManager.assembleComponent(DefaultComponentComposerManager.java:68) at org.codehaus.plexus.DefaultPlexusContainer.composeComponent(DefaultPlexusContainer.java:1486) at org.codehaus.plexus.personal