Read through a number of similar issues and some were completely different or didn't provide an explanation.
Here is how the application is executed. A size of 1234M is used to ensure no default value is being picked up. Also verified no Java related Environment Variables are set.
> java -Xms512M -Xmx1234M -jar myApp.jar
When the application loads, JVisualVM shows the following and based on the JVM Arguments the -Xmx is visble.
Under the Monitor tab, the graphical view is inspected and this shows a max heap size of 8G.
If multiple applications are running, this could be problematic. As a test, the _JAVA_OPTIONS=-Xms1024m -Xmx2222m environment variable is set. The value 2222 is used to help verify no default value gets picked up.
Once again JVisualVM shows the proper size passed in :
Under the Monitor tab, the graphical view is inspected and this shows the value from the environment variable.
Why does java not pickup the values passed in via the command line?



