[Building Sakai] tuning the JVM for maven

Aaron Zeckoski aaronz at vt.edu
Wed Jun 10 21:14:14 PDT 2009


Interesting results.
Normally there is no need to explicitly list the -server option on
java 1.5 machines because the compiler makes the best choice based on
your machine specs.
(from http://java.sun.com/performance/reference/whitepapers/tuning.html)

On my machine adding "-server" actually makes the build take about 20% longer.

The aggressive opts might be a good option, though on my machine
(macbook pro w/ java 1.5.0_16) it seems to make little difference (no
noticeable change in build speed). I added a note though that it could
be helpful to the sakai wiki page on maven 2 installation.

On a related note:
Make sure you benchmark the build with your network cable disconnected
or wireless turned off as offline builds will still try to go out to
the network for SNAPSHOT stuff once a day and any network traffic will
throw off your results (an offline build with -o took about 25% longer
than a really offline build in my tests just now). Also, make sure you
are doing "mvn clean install" (don't leave off the clean).

Hope that is helpful!
:-)
-AZ


On Thu, Jun 11, 2009 at 3:24 AM, Charles Hedrick<hedrick at rutgers.edu> wrote:
> I just found I could greatly speed up a build by changing some parameters.
> These are probably specific to my environment, but it still may be worth
> making some changes in the recommended MAVEN_OPTS
>
> Environment:
>
> Dell Optiplex 960 with 8 GB of memory, Intel Q9550, running OpenSuSE 11.1
> Xen VM  with 6 GB of memory and all 4 cores, running Centos 5.3, 64-bit
> Java 1.6.0u14 (from Sun, not the one that comes with Centos)
>
> By going from
>
> setenv MAVEN_OPTS '-Xms256m -Xmx512m -XX:PermSize=64m -XX:MaxPermSize=256m'
>
> to
>
> setenv MAVEN_OPTS '-server -Xms256m -Xmx1512m -XX:PermSize=256m
> -XX:MaxPermSize=256m -XX:+AggressiveOpts'
>
> I cut the time to build 2.6.x from over 11 min to 4 min.
>
> I started this investigation because I found that on my new Mac Pro, without
> changing any options, build time is about 3 min. This is using Apple's
> 64-bit 1.6.0u13. The Q9550 shouldn't be that much slower than the Xeon 5500.
>  I may play with tuning on the Mac to see if I can do a bit better. But I
> conjecture that Apple has different default JVM tuning that Sun's Linux
> code.
>
> (Incidentally, I'm not sure I recommend the Optiplex 960. It's a nice
> machine, but I wanted to run Solaris as the real OS. It won't boot on that
> machine. As a second choice, I chose OpenSuSE because of the major Linux
> distributions it seems to be the only one that is putting the Xen dom0
> patches into a current Linux kernel. This whole thing was a test. I'll
> almost certainly do my real work on a Mac Pro. But I figured others might be
> working under Linux.)
>
> (We're still doing our production builds under Java 5, but I'm using Java 6
> for development and testing. We're trying to move production to 6, but have
> run into a bug that crashes the VM. I believe we know what it is. I'll
> report on it when I'm sure. The current theory is that it's specific to
> Solaris.)
>
>
>
>
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org
> with a subject of "unsubscribe"
>
>



-- 
Aaron Zeckoski (azeckoski (at) vt.edu)
Senior Research Engineer - CARET - Cambridge University
https://twitter.com/azeckoski - http://www.linkedin.com/in/azeckoski
http://aaronz-sakai.blogspot.com/ -
http://confluence.sakaiproject.org/confluence/display/~aaronz/


More information about the sakai-dev mailing list