`

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.

分享到:
评论

相关推荐

    java6 JVM 调优参数大全

    java6 JVM 调优参数大全 -XX

    阿里+Java+开发手册、阿里巴巴Java性能调优实战

    《阿里+Java+开发手册、阿里巴巴Java性能调优实战》是两本专注于Java开发和性能优化的专业书籍,分别以嵩山版和华山版的形式呈现,由阿里巴巴集团编写。这两本书籍结合了阿里巴巴在实际业务场景中的丰富经验,旨在...

    java内存参数调优技巧

    4. **其他调优参数**: - `-XX:MaxGCPauseMillis` 设置垃圾回收的最大暂停时间,JVM会自动调整内存大小以尝试满足这个目标。 - `-XX:+UseAdaptiveSizePolicy` 开启自适应内存策略,让JVM根据运行时情况自动调整...

    阿里巴巴Java性能调优实战(2021华山版)

    性能调优标准告诉开发者可以通过哪些参数去衡量系统性能,而调优过程标准则带领开发者了解通过哪些严格的调优策略,可以排查性能问题,从而解决问题。 模块二:Java 编程性能调优 模块二主要讲解 Java 编程性能...

    JAVA虚拟机性能参数调优指导书.doc

    - **Java线程调优参数的使用**:线程池大小(-XX:ParallelGCThreads)和新生代大小(-Xmn)的调整对并发性能有直接影响。 5. **结束语** 虚拟机调优是一个复杂而细致的过程,需要结合具体应用的负载情况和硬件...

    JAVA应用JVM原理及参数调优深入讲解视频.zip

    JAVA应用JVM原理及参数调优深入讲解视频.1 JAVA应用JVM原理及参数调优深入讲解视频.2 JAVA应用JVM原理及参数调优深入讲解视频.3 JAVA应用JVM原理及参数调优深入讲解视频.4 JAVA应用JVM原理及参数调优深入讲解视频.5 ...

    Java性能调优命令

    在Java应用程序的性能调优过程中,掌握一系列命令行工具是至关重要的。这些工具可以帮助开发者监控应用程序的运行状态,诊断性能瓶颈,并对JVM进行调优。以下是一些常用的Java性能调优命令及其用法和相关知识点。 1...

    Java性能调优PPT

    ### Java性能调优知识点概述 #### 一、高性能Java代码编写原则 - **算法与数据结构**:选择合适的数据结构可以极大地提升程序运行效率。例如,对于查找操作频繁的场景,哈希表(如`HashMap`)比链表或数组更高效。...

    java性能调优的基本知识.pdf

    Java性能调优是提升应用程序效率的关键环节,尤其在大规模应用中更为重要。本文主要探讨了Java性能调优的基础知识,包括Java堆的管理和JDK调优策略。 Java堆是Java虚拟机(JVM)中用于存储对象的主要内存区域。它的...

    java性能调优及原理介绍.pdf

    Java性能调优主要聚焦在JVM的优化,其中...总的来说,Java性能调优涉及到对JVM内存模型的深入理解,合理配置JVM参数以优化内存使用,以及通过分析GC日志来改进垃圾收集的效率,从而避免或减少OOM异常,提升应用性能。

    Java虚拟机性能参数调优指导书

    - **Java线程调优参数的使用**:可能涵盖线程池大小的设定,线程优先级的调整,以及死锁和线程同步问题的避免。 5. **结束语**:作者可能在这部分总结了全书的主要观点,强调了持续学习和实践对于JVM调优的重要性...

    Java性能调优大全

    Java性能调优是一个复杂而重要的领域,涉及到程序的运行效率、资源消耗以及系统的稳定性。这份“Java性能调优大全”提供了全面的指南,包括VisualVM的使用、JVM的性能优化、OMM(可能是指Oracle Management Monitor...

    非常好用的java调优工具Jprofile

    Java性能优化是开发和运维过程中不可或缺的一环,而JProfiler是一款强大的Java调优工具,它提供了详尽的性能分析和内存管理功能,帮助开发者找出应用程序的瓶颈,提升系统效率。以下将详细介绍JProfiler的主要功能、...

    Java性能调优指南.pptx

    【Java性能调优指南】 在Java开发中,性能调优是一项关键任务,它涉及到程序运行效率、资源利用和系统稳定性。本指南主要关注Java虚拟机(JVM)调优、编码最佳实践以及微基准测试的重要性。 **基本规则** 1. **...

    Java虚拟机性能参数调优.docx

    "Java虚拟机性能参数调优" Java虚拟机性能参数调优是Java开发中一个非常重要的方面。Java虚拟机(JVM)是Java技术的基石,它是一种虚拟机技术,融合了编译技术、CPU技术,能够识别Java字节码并将其翻译成机器能够...

    jvm 参数调优实践

    JVM参数调优是优化Java应用程序性能的关键环节,尤其是在服务器端的应用中,如Web服务器Resin。本实践案例中,作者分别尝试了三种不同的垃圾回收(GC)策略:串行回收、并行回收和并发回收,并针对每种策略提供了...

    Java虚拟内存调优参数说明

    本文档详细介绍了怎么样调java虚拟内存

    JAVA性能测试与调优案例

    根据提供的文件信息,本文将对“JAVA性能测试与调优案例”进行详细的知识点解析。 ### JDK优化 首先,文档提到了Java虚拟机(JVM)的不同版本。JVM的动态库分为client和server两个版本,这分别针对桌面应用和服务器...

Global site tag (gtag.js) - Google Analytics