You are setting MAVEN_OPTS
, but you aren't executing Maven, so nothing is going to care about that environment variable. You are ultimately trying to set the JVM option, and the easiest way in this case is via JRUBY_OPTS
:
$ JRUBY_OPTS='-J-XX:MaxPermSize=1G' ruby -e 'puts java.lang.management.ManagementFactory.getMemoryPoolMXBeans.map {|p| "#{p.name}: #{p.usage.max}"}'
PS Perm Gen: 1073741824
$ JRUBY_OPTS='-J-XX:MaxPermSize=2G' ruby -e 'puts java.lang.management.ManagementFactory.getMemoryPoolMXBeans.map {|p| "#{p.name}: #{p.usage.max}"}'
PS Perm Gen: 2147483648