I was using a tool. The JVM option is configurable.
Recently, I get a OutOfMemoryError so I add -Xmx1024m in the option configuration as below.
The config.properties: JVM_OPTION="-Xmx4096m -XX:-UseGCOverheadLimit"
The cmd log before: java -Xms16777216 -Xmx50m com.f.Startmain
The cmd log now: java -Xms16777216 -Xmx50m com.f.Startmain -Xmx4096m -XX:-UseGCOverheadLimit
The tool is still out of memory now as the -Xmx4096m is not overwrite the old one. The tool is not modifiable, and the configuration is only adding new options at the end of the command.
Could someone know a method to overwrite -Xmx50m in JVM options?
This seems to have been answered here
apparently for both windows and linux, you can set:
I ran a quick test and this seems to override the commandline params. (unexpected)
my code:
This is the output of running this program
As you can see, the Xmx value on the commandline is ignored until I clear the _JAVA_OPTIONS.