java -Xmx1024m filename

-Xmx是什么意思?

推荐答案

看这里:Java Tool Doc,上面写着,

-Xmxn
Specify the maximum size, in bytes, of the memory allocation pool. This value must a multiple of 1024 greater than 2MB. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. The default value is 64MB. The upper limit for this value will be approximately 4000m on Solaris 7 and Solaris 8 SPARC platforms and 2000m on Solaris 2.6 and x86 platforms, minus overhead amounts. Examples:

           -Xmx83886080
           -Xmx81920k
           -Xmx80m

因此,简单地说,您将Java堆内存设置为可用内存的最大1024MB,而不是更多.

Notice there is NO SPACE between -Xmx and 1024m

不管你用大写还是小写.例如:"-Xmx10G"和"-Xmx10G"做完全相同的事情.

Java相关问答推荐

弹簧靴和龙目岛

使用JdkClientHttpRequestFactory通过Spring RestClient和Wiemock读取时达到EOF

Java inline Double条件和值解装箱崩溃

为什么在枚举中分支预测比函数调用快?

有没有办法让扩展变得多态?

第二次按下按钮后,我需要将按钮恢复到其原始状态,以便它可以再次工作

如何使用SpringBoot中的可分页对整数作为字符串存储在数据库中时进行排序

带错误BER验证的itext8签名返回pdf

Arrays.hashcode(int[])为不同的元素提供相同的散列

SpringBoot:在条件{Variable}.isBlank/{Variable}.isEmpty不起作用的情况下进行路径变量验证

为了安全起见,有必要复制一份 list 吗?

如何在Maven Central上部署?

使用@ExceptionHandler的GlobalExceptionHandler还是来自服务器的REST应答的ResponseEntity?

在Spring Boot中使用咖啡因进行缓存

使用同步方法中的新线程调用同步方法

谷歌应用引擎本地服务器赢得';t在eclipse上运行

如何在JSP中从select中获取值并将其放入另一个select

如何使用Jackson读取以方括号开头的JSON?

如何仅记录在 java 中更新 API 调用期间获得更新的字段?

终止等待 C 中空/满的阻塞数据 struct 的消费者/生产者线程的最佳方法是什么?