-Xmx与-Xms实践认识

本文通过设置JVM的-Xms和-Xmx参数进行内存管理实验,观察GC对堆内存的影响及如何避免频繁调整堆大小。

 

Today,I took an exercise about the -Xms main memory in jvm mechine.
 My english is very poor,fuck.
   Let's set -Xms=64M
                 -Xmx=512M

 

Then I open jconsole and listenning the pid in process.
then we seethe follow picture.

we see that while the value of main memory which is being aliving will get down when near 70M,and then,
it will grow up,and then down...

Just as book says that -Xms is something that is applied smallest for jvm while  -Xmx is the biggest.
-Xms,which is default as  1/64 of memory of physical hardpan.
and -Xmx,1/4 of memory of physical hardpan.
while the free working memory is less than 40 percent or more than 70 percent,jvm will adjust Heap to -Xmx or -Xms.
The reason that the free working memory will get down is GC.
Just as picture shows above.
So as to be avoid adjusting the size of Heap frequently,we shall set -Xms equals to -Xms

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值