News and Notes from the Makers of Nexus | Sonatype Blog

How JVM Settings Affect Flexmojos Performance | Sonatype

Written by Marvin Froeder | October 19, 2009

Flex compiler uses lots of memory and CPU resources, so does Flexmojos. There's not much new in here.

Some time ago, I read this blog post with some memory parameter suggestions. And guess what, compilation becomes faster using it.

There are two ways to change maven JVM settings.

1 - Editing Launch Files

Edit mvn (non-Windows) or mvn.bat (windows) and add the following line:

$ set MAVEN_OPTS=-Xms512m -Xmx1024m -XX:MaxPermSize=256m -XX:PermSize=64m

On Windows, you can add that on the first line, and on non-Windows systems, you must add that after "#!/bin/sh"

2 - Setting an Environment Variable

This process will vary from OS to OS.

Just add an environment variable with name equal to "MAVEN_OPTS" and the value equal to "-Xms512m -Xmx1024m -XX:MaxPermSize=256m -XX:PermSize=64m" both w/o quotes.

The main advantage for the second method is that it will still work even after Maven is updated.