I have found a legacy software that we’re using that has its launch properties malformed, so it receives these two unequal xmx as a properties:
java -jar myapp.jar -Xmx128m -Xmx512m
I do not have access to the launcher source code(not being able to modify it), so I ask, what is the impact of the duplication of these parameters? Can I leave this in this way, or should I worry? Which one will be applied?
The JVM used is JRE 6 update 18
In general, it’s usually the latter option that gets used if a tool doesn’t reject a duplicate, but you can’t count on that unless the tool documents it.
Your best bet is to see what happens with your specific JVM, via
Runtime‘stotalMemoryandmaxMemory:On my JVM (Sun/Oracle 1.6.0_26-b03 under Linux), the latter option takes effect: