JVM命令启动选项重复
我发现我们正在使用的一个遗留软件的启动属性格式错误,因此它接收这两个不相等的 xmx 作为属性:
java -jar myapp.jar -Xmx128m -Xmx512m
我无权访问启动器源代码(无法修改它),所以我请问,这些参数重复有什么影响?我可以就这样离开吗,还是应该担心?将应用哪一种?
使用的 JVM 是 JRE 6 update 18
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一般来说,如果工具不拒绝重复项,通常会使用后一个选项,但除非该工具记录它,否则您不能指望这一点。
最好的办法是通过
Runtime
的totalMemory
和maxMemory
< /a>:在我的 JVM(Linux 下的 Sun/Oracle 1.6.0_26-b03)上,后一个选项生效:
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
'stotalMemory
andmaxMemory
:On my JVM (Sun/Oracle 1.6.0_26-b03 under Linux), the latter option takes effect:
我的理解是它将使用最后的设置。
My understanding it that it will use the last setting.