Last time I put the initial memory 32M, Maximum memory 512M, It's time for me to change the initial memory to equal ,512M, I'll restart the server -XX:+PrintGCDetails
-Xmx512M –Xms512M -XX:+HeapDumpOnOutOfMemoryError -XX:+UseSerialGC
-XX:PermSize=32M Let's see the effect , Is there any GC Recycling of , Isn't that right , We can count it out ,0 second , Don't you need to say that , I can see the result
GC How many times is it recycled 0 second , Let's talk about it here , What is the throughput , What is the approximate range , Must be 5000 above , This is for sure , I guess 7,8 thousand ,
almost , Empty it , function , Let's see if there are any GC recovery , Isn't that right , We haven't finished running , Throughput in 5015
Do any of you know why , Why less , Do any of you know , This is actually a part of the software bug problem , When running
How to get smaller and smaller , What is the reason , Do you know why , This software has Bug, Forever only in 100 More inside , See
Is it still there 100 many , This software has bug, You'd better not do that , go HTTP Request menu click execute , Is it already high
See ,6561 second , See the effect , It's smaller because of the graphical interface , You don't need to show the report, you need to see the report , When graphics are running, it will affect
Our throughput is high , This software has bug, So I won't say that , Then you know ,6561 second , throughput 6561 second , This is when I get rid of it , I'll do it again , 6702 second
I'll clean it up , I'm running once , He'll get taller again , Because he has the ability to cache the request , It's going to get higher ,6626, Basically 6600 About
At this time, we can make a summary , If the initial value of the heap is consistent with the maximum value , And the larger the initial value of the heap, the higher it will be , In fact, you can sum up one
Come to the conclusion , First of all, why have an initial memory , In fact, we should remember one thing , put in plain language , The initial value of the heap should be the same as the initial memory of the heap , This is the first condition ,
If you have more initial heap memory , The higher it is , And did you find out , I'm going to run it now 4,5 Times , He'll have one GC recovery , We ran it many times , This time GC
Definitely not , Generally you don't set it full , You just set it half way ,16G You set it to 8G That's it , Because you have other memory to use , So this is
Let's draw a conclusion for you , And then you think about it , I set 512M, I use serial recycling , I set 512M When I was young , And initial value 32M When I was young ,
What's the difference , The difference is several times , Right? 1000 many times , Is that right , And how many times is it different from what we started , difference 2000 many times , So why sometimes
Do you want to make the initial memory larger , This is the end of serial , If someone asks you ,JVM What are the basic principles of tuning , The first is the reduction GC recovery
frequency , because GC Recycling itself will affect the efficiency of the program , The second point is that the initial value and the maximum value of the heap must be consistent , Because of the number of garbage collections and setting the maximum memory of the heap
irrelevant , It is related to the initial heap memory size , I've finished with serial recycling Adjust initial heap -XX:+PrintGCDetails -Xmx512M –Xms512M
-XX:+HeapDumpOnOutOfMemoryError -XX:+UseSerialGC -XX:PermSize=32M GC Recovery times 0 second
throughput 6561 second conclusion : The initial value of the heap is consistent with the maximum heap memory , And the larger the initial heap, the higher it will be .
Technology