zoukankan      html  css  js  c++  java
  • [Note][深入理解Java虚拟机] 第三章 垃圾收集器与内存分配策略笔记

    书上关于GCTimeRatio的讲解有点难以理解,查看Oracle的文档后重新理解了下
    -XX:GCTimeRatio 运行时间 / GC时间

    当GCTimeRatio为19时,运行时间是GC时间的19倍,也就是GC时间不能超过 1 / (1 + 19) = 0.05

    附上Oracle的文档原文

    -XX:GCTimeRatio=nnn
    A hint to the virtual machine that it's desirable that not more than 1 / (1 + nnn) of the application execution time be spent in the collector.
    For example -XX:GCTimeRatio=19 sets a goal of 5% of the total time for GC and throughput goal of 95%. That is, the application should get 19 times as much time as the collector.

    By default the value is 99, meaning the application should get at least 99 times as much time as the collector. That is, the collector should run for not more than 1% of the total time. This was selected as a good choice for server applications. A value that is too high will cause the size of the heap to grow to its maximum.

    Reference

    1. Garbage Collector Ergonomics
  • 相关阅读:
    机器学习中的规则化
    TF-IDF 文本相似度分析
    数据分析实践:遇到的问题及感想
    记录工作中用到的linux命令
    回归:预测数值型数据
    FP
    Application
    Mac安装sqlite3
    查看百度CUID方法
    leetcode算法题整理
  • 原文地址:https://www.cnblogs.com/arcsinw/p/11977204.html
Copyright © 2011-2022 走看看