Setting these to the same value fixes the young generation, just as setting -Xms and -Xmx to the same value fixes the total heap size. The parameters NewSize and MaxNewSize bound the young generation size from below and above. In other words, the combined size of the eden and survivor spaces will be one-fourth of the total heap size. For example, setting -XX:NewRatio=3 means that the ratio between the young and tenured generation is 1:3. The optimal choice depends on the lifetime distribution of the objects allocated by the application.īy default, the young generation size is controlled by the parameter NewRatio. However, for a bounded heap size, a larger young generation implies a smaller tenured generation, which will increase the frequency of major collections. The bigger the young generation, the less often minor collections occur. In general, increase the memory as you increase the number of processors, since allocation can be parallelized.Īfter total available memory, the second most influential factor affecting garbage collection performance is the proportion of the heap dedicated to the young generation. However, the virtual machine is then unable to compensate if you make a poor choice. Setting -Xms and -Xmx to the same value increases predictability by removing the most important sizing decision from the virtual machine. Unless you have problems with pauses, try granting as much memory as possible to the virtual machine. The following are general guidelines regarding heap sizes for server applications: There is a similar calculation for the client JVM, which results in smaller maximum heap sizes than for the server JVM. See the section Default Heap Size in The Parallel Collector. Part of the calculation is an upper limit on the maximum heap size that is different for 32-bit platforms and 64-bit platforms. The calculation used in Java SE for the parallel collector and the server JVM are now used for all the garbage collectors. Similarly, if the free space exceeds 70%, then the generation will be contracted so that only 70% of the space is free, subject to the minimum size of the generation.Īs noted in Table 4-1, "Default Parameters for 64-Bit Solaris Operating System", the default maximum heap size is a value that is calculated by the JVM. With these parameters, if the percent of free space in a generation falls below 40%, then the generation will be expanded to maintain 40% free space, up to the maximum allowed size of the generation. Table 4-1 Default Parameters for 64-Bit Solaris Operating System Parameter The default parameters for the 64-bit Solaris operating system (SPARC Platform Edition) are shown in Table 4-1, "Default Parameters for 64-Bit Solaris Operating System": This target range is set as a percentage by the parameters -XX:MinHeapFreeRatio= and -XX:MaxHeapFreeRatio=, and the total size is bounded below by -Xms and above by -Xmx. Because collections occur when generations fill up, throughput is inversely proportional to the amount of memory available.īy default, the virtual machine grows or shrinks the heap at each collection to try to keep the proportion of free space to live objects at each collection within a specific range. The most important factor affecting garbage collection performance is total available memory. (See the section Parallel Collector Ergonomics in Sizing the Generations for details on heap resizing and default heap sizes with the parallel collector.) However, the parameters that control the total size of the heap and the sizes of the generations do apply to the parallel collector. The following discussion regarding growing and shrinking of the heap and default heap sizes does not apply to the parallel collector.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |