>> How can I specify that the JVM used by Maven may consume more memory?

> In maven.bat

Specifically, you can pass an argument to any command-line invocation of
Java, so this is not Maven specific. Maven.bat invokes the JVM with this
evil line:

%MAVEN_JAVA_EXE%
-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBu
ilderFactoryImpl
-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactory
Impl "-Dmaven.home=%MAVEN_HOME%" "-Dtools.jar=%JAVA_HOME%\lib\tools.jar"
"-Dforehead.conf.file=%MAVEN_HOME%\bin\forehead.conf" %MAVEN_ENDORSED%
%MAVEN_OPTS% -classpath %MAVEN_CLASSPATH% %MAVEN_MAIN_CLASS%
%MAVEN_CMD_LINE_ARGS%

Which gets expanded to this:

"D:\j2sdk1.4.1\bin\java.exe"
-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.Document
BuilderFactoryImpl
-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactory
Impl "-Dmaven.home=D:\Programming
\Projects\maven" "-Dtools.jar=D:\j2sdk1.4.1\lib\tools.jar"
"-Dforehead.conf.file=D:\Programming\Project
s\maven\bin\forehead.conf"
"-Djava.endorsed.dirs=D:\j2sdk1.4.1\lib\endorsed;D:\Programming\Projects\mav
en\lib\endorsed" "-Xmx160m" -classpath
"D:\Programming\Projects\maven\lib\forehead-1.0-beta-4.jar"
"com.werken.forehead.Forehead

The key bit is the -Xmx160m part. This controls the memory allocation of the
JVM. In the Maven.bat file, this happens to be in the MAVEN_OPTS variable.
The options you need are:

-Xms<size>        set initial Java heap size
-Xmx<size>        set maximum Java heap size
-Xss<size>        set java thread stack size

So, the -Xmx160m option means "set maximum Java heap size to 160MB". Change
this to -Xmx256m or whatever.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to