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 运行时选项:优先顺序是什么?
基础教程推荐
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- RabbitMQ:消息保持“未确认"; 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
