Customising the JVM memory allocation using MAVEN_OPTS

A while back, I kept getting

java.lang.OutOfMemoryError: Java heap space 

...type errors, working on a large Java legacy system. There were some files in there with over 3000 lines of code! It was a bit of a death march project, to be honest.

Anyway, I messed around for a little while with different attempts at setting MAVEN_OPTS to give the JVM a decent amount of memory, here's what i ended up with:

MAVEN_OPTS='-Xms256m -XX:MaxPermSize=1024m -Xmx1024m'