Duplicated Java runtime options : what is the order of preference?(重复的 Java 运行时选项:优先顺序是什么?)
问题描述
考虑下面的命令行
java -Xms128m -Xms256m myapp.jar
JVM 最小内存(Xms
选项)适用哪些设置:128m 或 256m?
Which settings will apply for JVM Minimum memory (Xms
option) : 128m or 256m ?
推荐答案
取决于 JVM,也许是版本......也许甚至可能是你当时桌上有多少个回形针.它甚至可能不起作用.不要那样做.
Depends on the JVM, perhaps the version...perhaps even how many paper clips you have on your desk at the time. It might not even work. Don't do that.
如果由于某种原因它超出了您的控制范围,请以与运行 jar 相同的方式编译和运行它.但请注意,依赖选项的顺序是一个非常糟糕的主意.
If it's out of your control for some reason, compile and run this the same way you'd run your jar. But be warned, relying on the order of the options is a really bad idea.
public class TotalMemory
{
public static void main(String[] args)
{
System.out.println("Total Memory: "+Runtime.getRuntime().totalMemory());
System.out.println("Free Memory: "+Runtime.getRuntime().freeMemory());
}
}
这篇关于重复的 Java 运行时选项:优先顺序是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:重复的 Java 运行时选项:优先顺序是什么?


- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- Jersey REST 客户端:发布多部分数据 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01