开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜