JAVA 调优参数

Throughput Goal
      -XX:GCTimeRatio=19 sets a goal of 1/20th or 5% of the total time for garbage collection.
Maximum Pause Time Goal
      -XX:MaxGCPauseMillis=<nnn>. This is interpreted as a hint to the garbage collector that pause times of <nnn> milliseconds or less are desired.

GC Parameters
   -XX:+PrintGCDetails
        The command-line option -XX:+PrintGCDetails causes additional information about the collections to  be printed
   -XX:+PrintGCTimeStamps
        The option -XX:+PrintGCTimeStamps adds a time stamp at the start of each collection

   -XX:+UseSerialGC

         It  is best-suited to single processor machines, because it cannot take advantage of multiprocessor hardware, although it can be useful on multiprocessors for applications with small data sets (up to approximately 100 MB)

   -XX:+UseParallelGC.

       It is intended for applications with medium-sized to large-sized data sets that are run on multiprocessor or multithreaded hardware. Parallel compaction is enabled by default if the option -XX:+UseParallelGC has been specified. The option to turn it off is -XX:-UseParallelOldGC.

   -XX:+UseConcMarkSweepGC

      It  is designed for applications that prefer shorter garbage collection pauses and that can afford to share processor resources with the garbage collector while the application is running

 

-XX:+UseG1GC

       It is a server-style garbage collector, targeted for multiprocessor machines with large memories. It attempts to meet garbage collection (GC) pause time goals with high probability while achieving high throughput. Whole-heap operations, such as global marking, are performed concurrently with the application threads. This prevents interruptions proportional to heap or live-data size

 

Summary

      use the concurrent collector to reduce pause times and use the parallel collector to increase overall throughput on multiprocessor hardware.

 

Heap Parameters

 Description of Figure 4-1 follows

 

Total Heap

 -XX:MinHeapFreeRatio=<minimum> [default:40]and -XX:MaxHeapFreeRatio=<maximum>[default:70], and the total size is bounded below by -Xms<min> and above by -Xmx<max>

 

Young Heap

        -XX:NewRatio=3 means that the ratio between the young and tenured generation is 1:3. In other words, the combined size of the eden and survivor spaces will be one-fourth of the total heap size

    

        The parameters NewSize and MaxNewSize bound the young generation size from below and above. 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. This is useful for tuning the young generation at a finer granularity than the integral multiples allowed by NewRatio.

    -XX:SurvivorRatio=6 sets the ratio between eden and a survivor space to 1:6. In other words, each survivor space will be one-sixth the size of eden, and thus one-eighth the size of the young generation

 

The Parallel Collector        

             Description of Figure 6-1 follows

      -XX:ParallelGCThreads=<N>

              The fraction is approximately 5/8 for large values of N. At values of N below 8, the number used is N. On selected platforms, the fraction drops to 5/16

      -XX:MaxGCPauseMillis=<N>.

              This is interpreted as a hint that pause times of <N> milliseconds or less are desired; by default, there is no maximum pause time goal. If a pause time goal is specified, the heap size and other parameters related to garbage collection are adjusted in an attempt to keep garbage collection pauses shorter than the specified value

       -XX:GCTimeRatio=<N>

          It sets the ratio of garbage collection time to application time to 1 / (1 + <N>).
For example, -XX:GCTimeRatio=19 sets a goal of 1/20 or 5% of the total time in garbage collection. The default value is 99, resulting in a goal of 1% of the time in garbage collection.

      Growing and shrinking the size of a generation is done by increments that are a fixed percentage of the size of the generation so that a generation steps up or down toward its desired size. Growing and shrinking are done at different rates. By default a generation grows in increments of 20% and shrinks in increments of 5%. The percentage for growing is controlled by the command-line option -XX:YoungGenerationSizeIncrement=<Y> for the young generation and -XX:TenuredGenerationSizeIncrement=<T> for the tenured generation. The percentage by which a generation shrinks is adjusted by the command-line flag -XX:AdaptiveSizeDecrementScaleFactor=<D>. If the growth increment is X percent, then the decrement for shrinking is X/D percent.

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值