Considering the following command line
java -Xms128m -Xms256m myapp.jar
Which settings will apply for JVM Minimum memory (Xms
option) : 128m or 256m ?
jvmoptions file. For a ZIP distribution, the file is located in the <YouTrack installation directory>/conf directory. Edit the JVM options directly in the file.
JVM arguments are flags that are passed to the Java Virtual Machine at the time the application is launched. On Linux or Mac machines, they can be provided through the JAVA_OPTS setting in the whd.conf file.
Editing the Java Options File from the Command Line: Open the Terminal program (CTRL+ALT+T). Open the Java Options file in a text editor (such as nano) by typing the following command: sudo nano /etc/opt/fusion/java. options . Then press Enter.
7.1 Configuring the Default JVM and Java Arguments. The directory server provides a means of configuring the Java Virtual Machine (JVM) and Java options for each command-line utility and for the directory server itself. The Java configuration is provided in a properties file, located at instance-dir/OUD/config/java.
As always, check your local JVM's specific implementation but here is a quick way to check from the command line without having to code.
> java -version; java -Xmx1G -XX:+PrintFlagsFinal -Xmx2G 2>/dev/null | grep MaxHeapSize java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) uintx MaxHeapSize := 2147483648 {product}
So you'll see in this case, the second instance of the argument (2G) is what takes precedence (at least in 1.8) and that has been my experience with most other modern versions as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With