开发者

limit for max heap size in java heap setting

开发者 https://www.devze.com 2023-03-29 18:36 出处:网络
is there limit to increase the max heap size in java?I am wondering if the large heap size can be set as l开发者_如何学Goong as the physical memory is available.

is there limit to increase the max heap size in java? I am wondering if the large heap size can be set as l开发者_如何学Goong as the physical memory is available.

For example, if a server has 100G for RAM, then can i set the max heap at 90G? I know that GC will halt the app, but I am just curious.

Thanks.


With a 32 bit JVM, the hard limit would be 4 GB but the actual one would be lower as, at least if you aren't running a 64 bit OS, some space must be left for non heap memory, like the JVM own address space (non java), stacks for all threads, architecture/OS limitations and the likes. A 64 bit JVM has no such limitation so you could set the limit to 90 GB although I wouldn't recommend it for the reason you already pointed.

0

精彩评论

暂无评论...
验证码 换一张
取 消