When the Java memory stack is not sufficient we will seek help from Java parameters-xms and-xmx. There are many examples on the internet, but many people like to set the value of-XMS and-xmx to the same, even I have seen that there is a bar-xms than-xmx (-XMS is the minimum value,- XMX is the maximum value).
At first I didn't know what the problem was with the two values, but when I was doing the project http://youmonitor.us/I found that when I set the-XMS and-xmx to be the same, Java kept eating the memory. At first I didn't know what was going on. After testing, found that the original Java garbage collector in memory to achieve the-XMS value when the start of recycling, if the same two values, which means that only when the Java use of all the memory will be recycled garbage, so the memory of course constantly rise.
And there are a number of GC policies for the same JDK, which cannot be generalized
In addition, under the sun's JDK, the XMS and XMX settings can reduce the pressure on the size of the telescopic heap, but under the IBM JDK, setting the same will increase the probability of heap fragmentation, and this negative effect is sufficient to counteract the benefits of the former