Thanks for all the work on the sbt plugin. I'm trying to override my sbt config to use a custom Xmx memory setting. The documented way of using:
does not work for me and my JVM just ends up using the value from `DefaultJvmArgs` (-Xmx512m). My workaround is to place the arguments at the end of `javaOptions` instead with:
I think this happens because `overrideDefaultJavaOptions` places custom JVM arguments at the beginning of the list:
Whereas my JVM uses the last value present. Perhaps parameter order of precedence is different from one JVM implementation to another?
More details below. Thanks very much.
Using this line in my build.sbt:
javaOptions in Gatling := overrideDefaultJavaOptions("-Xmx2G" )
Results in the following sbt `javaOptions` sequence, i.e. the override setting is at the head of the list followed by the Gatling defaults:
> show javaOptions
[info] ArrayBuffer(-Xmx2G, -server, -XX:+UseThreadPriorities, -XX:ThreadPriorityPolicy=42, -Xms512M, -Xmx512M, -Xmn100M, -XX:+HeapDumpOnOutOfMemoryError, -XX:+AggressiveOpts, -XX:+OptimizeStringConcat, -XX:+UseFastAccessorMethods, -XX:+UseParNewGC, -XX:+UseConcMarkSweepGC, -XX:+CMSParallelRemarkEnabled)
When running the Gatling simulation, `jconsole` tells me that the JVM arguments were:
`-Xmx2G -Dhttp.nonProxyHosts=local|*.local|169.254/16|*.169.254/16 -DsocksNonProxyHosts=local|*.local|169.254/16|*.169.254/16 -Dftp.nonProxyHosts=local|*.local|169.254/16|*.169.254/16 -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms512M -Xmx512M -Xmn100M -XX:+HeapDumpOnOutOfMemoryError -XX:+AggressiveOpts -XX:+OptimizeStringConcat -X:+UseFastAccessorMethods -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled`
i.e. the order from `javaOptions` was retained.
My JVM appears to use the right-most value specified:
> java -Xms256m -Xmx512m -Xmx2048m -XX:+PrintFlagsFinal -version | grep MaxHeapSize
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
So should overrides be placed at the end of the list instead? (or possibly at the start and the end of the list? or possibly replace existing values in the list?)