如果在没有任何选项的情况下运行JVM,对内存使用有何影

时间:2022-06-13 17:17:41

We have 64-bit Oracle JRE 8 and our application start as:

我们有64位Oracle JRE 8,我们的应用程序启动为:

java -jar C:\path\to\app.jar

How JVM does uses memory in that case (when you do not set -Xmx and other options)?

在这种情况下JVM如何使用内存(当你没有设置-Xmx和其他选项时)?

2 个解决方案

#1


2  

So the max memory consumption limited even in 64-bit machine by default... But this number differs for same JVM but different hosts.

因此,默认情况下,即使在64位计算机中,最大内存消耗也受到限制......但是这个数字因同一个JVM而不同主机而不同。

For openjdk and oracle jvms this is governed by the MaxRAMFraction option, which under 64bit defaults to 4, i.e. 25% of physical memory.

对于openjdk和oracle jvms,它由MaxRAMFraction选项控制,该选项在64位下默认为4,即物理内存的25%。

#2


0  

I don't remember correct, but as i know jvm will not use more than 25% of RAM if you will not specify -Xmx or -Xms

我不记得是正确的,但据我所知,如果你不指定-Xmx或-Xms,jvm将不会使用超过25%的RAM

#1


2  

So the max memory consumption limited even in 64-bit machine by default... But this number differs for same JVM but different hosts.

因此,默认情况下,即使在64位计算机中,最大内存消耗也受到限制......但是这个数字因同一个JVM而不同主机而不同。

For openjdk and oracle jvms this is governed by the MaxRAMFraction option, which under 64bit defaults to 4, i.e. 25% of physical memory.

对于openjdk和oracle jvms,它由MaxRAMFraction选项控制,该选项在64位下默认为4,即物理内存的25%。

#2


0  

I don't remember correct, but as i know jvm will not use more than 25% of RAM if you will not specify -Xmx or -Xms

我不记得是正确的,但据我所知,如果你不指定-Xmx或-Xms,jvm将不会使用超过25%的RAM