开发者

Does -Xmx stop automatic GC till maximum memory is consumed?

开发者 https://www.devze.com 2023-02-04 01:13 出处:网络
My question is simple. I have an application that specifies the \"-Xmx 3G\" command line option. Does this mean that no garbage collection will take place in the application till all (or say 80%) the

My question is simple. I have an application that specifies the "-Xmx 3G" command line option. Does this mean that no garbage collection will take place in the application till all (or say 80%) the 3GB of memory is consumed? Any further reading material w开发者_如何学JAVAould be appreciated as well.


No. A minor gc can occur even before the minimum memory -ms has been reached. The JVm reserves the maximum memory -mx on startup. However you can get full collections before this size is reached.


No. A simple test would demonstrate that!

0

精彩评论

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