Oracle JDK

  1. 概览


    image.png
  2. docs
    https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/

3.JMM

A number of parameters affect generation size. (https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/sizing.html#heap_parameters) illustrates the difference between committed space and virtual space in the heap. At initialization of the virtual machine, the entire space for the heap is reserved. The size of the space reserved can be specified with the -Xmx option. If the value of the -Xms parameter is smaller than the value of the -Xmx parameter, than not all of the space that is reserved is immediately committed to the virtual machine. The uncommitted space is labeled "virtual" in this figure. The different parts of the heap (tenured generation and young generation) can grow to the limit of the virtual space as needed.

image.png

Xmx
Xms
Xmn
-XX:SurvivorRatio 配置 Surviro区占Young区的比例

4.收集器

  • -XX:+UseParallelGC 默认情况下启用并行压缩 关闭的选项是-XX:-UseParallelOldGC

-XX:+UseConcMarkSweepGC
-XX:+UseG1GC


  • If the application has a small data set (up to approximately 100 MB), then
    select the serial collector with the option -XX:+UseSerialGC

  • If the application will be run on a single processor and there are no pause time requirements, then let the VM select the collector, or select the serial collector with the option -XX:+UseSerialGC.

  • If (a) peak application performance is the first priority and (b) there are no pause time requirements or pauses of 1 second or longer are acceptable, then let the VM select the collector, or select the parallel collector with -XX:+UseParallelGC.

  • If response time is more important than overall throughput and garbage collection pauses must be kept shorter than approximately 1 second, then select the concurrent collector with -XX:+UseConcMarkSweepGC or -XX:+UseG1GC.


©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容