`
chenchao051
  • 浏览: 135585 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

mark下G1

阅读更多

简单mark下,不知道是否真有说的那么好。
Garbage-First (G1) Collector is a server-style garbage collector, targeted for multi-processors with large memories, that meets a soft real-time goal with high probability, while achieving high throughput. G1 is the long term replacement of the Concurrent Mark-Sweep Collector (CMS). Whole-heap operations, such as global marking, are performed concurrently with the application threads, to prevent interruptions proportional to heap or live-data size. Concurrent marking provides both collection "completeness" and identifies regions ripe for reclamation via compacting evacuation. This evacuation is performed in parallel on multi-processors, to decrease pause times and increase throughput.

这边也提到了主要针对多处理器,并且有较大的内存。按他的说法,CMS就可以被G1所替代了。总之就是减少应用的暂停时间,增大吞吐量。

The G1 collector achieves these goals through several techniques. The heap is partitioned into a set of equal-sized heap regions, each a contiguous range of virtual memory. G1 compacts as it proceeds. It copies objects from one area of the heap to the other. Thus, it will not encounter fragmentation issues that CMS might encounter. There will always be areas of contiguous free space from which to allocate, allowing G1 to have consistent pauses over time. G1 uses a pause prediction model to meet a user-defined pause time target. It achieves smoother pause times than CMS at comparable throughput.
说是堆被分成了相当大小的区域,而每一个区域都是连续的。G1还是像以前一样的去压缩,把对象从一个区域复制到另一个区域,这样就避免了内存碎片,而这正是CMS经常遇到的问题。
并且呢,总会有连续的空的空间来分配。G1用了一个“预测模型”,来达到可以满足用户自定义pause time的目标。总之呢,就是在和CMS吞吐量差不多的情况下,G1的pause time更为平滑。

After G1 performs a global marking phase determining the liveness of objects throughout the heap, it will immediately know where in the heap there are regions that are mostly empty. It will tackle those regions first, potentially making a lot of space available. This way, the garbage collector will obtain more breathing space, decreasing the probability of a full GC. This is also why the garbage collector is called Garbage-First. As its name suggests, G1 concentrates its collection and compaction activity first on the areas of the heap that are likely to be full of reclaimable objects, thus improving its efficiency.
这一段也简单阐述了下,G1关注的是那些充满着可回收对象的堆。


While most real-time collectors work at the highly granular level of individual objects, G1 collects at the region level. If any region contains no live objects it is immediately reclaimed. The user can specify a goal for the pauses and G1 will do an estimate of how many regions can be collected in that time based on previous collections. So, the collector has a reasonably accurate model of the cost of collecting the regions, and therefore "the collector can choose a set of regions that can be collected within a given pause time limit with high probability." In other words, G1 is not a hard real-time collector - it meets the soft real-time goal with high probability but not absolute certainty. G1 attempts to yield higher throughput in return for the softer, but still moderately stringent, real-time constraints. This is a good fit for large-scale server applications which often have large amounts of live heap data and considerable thread-level parallelism. G1 also provides some finer control, allowing a user to specify a fraction of time during a period of execution to be spent on garbage collection. For example, for every 250ms of execution spend no more than 50ms on garbage collection.

G1 is planned to replace CMS in the Hotspot JVM. There are two major differences between CMS and G1. The first is that G1 is a compacting collector. G1 compacts sufficiently to completely avoid the use of fine-grain free lists for allocation, which considerably simplifies parts of the collector and mostly eliminates potential fragmentation issues. As well as compacting, G1 offers more predictable garbage collection pauses than the CMS collector and allows users to set their desired pause targets.
G1就是要在hotspot中来代替cms,总结了G1和cms的两个不同点。首先G1是一个压缩搜集器。其次就是G1提供了更可预测的pause time。

恩,先简单mark下好了,回头再仔细看看。。。

分享到:
评论

相关推荐

    题目1002:Grading

    For each problem, there is a full-mark P and a tolerance T() given. The grading rules are: • A problem will first be assigned to 2 experts, to obtain G1 and G2. If the difference is within the ...

    Java应用的垃圾回收优化

    这些方法包括但不局限于以下几点:并发标记清除(Concurrent Mark Sweep,CMS)和G1垃圾回收器的CPU和内存开销,避免长期存活对象引起的持续GC周期,优化GC线程任务分配使性能提升,以及GC停顿时间可预测所需的OS设置。

    联想Marker2.1.zip

    LENOVOTP-G1 LENOVOTP-G2 LENOVOTP-G3 LENOVOTP-G4 LENOVOTP-G5 LENOVOTP-G6 LENOVOTP-G7 LENOVOTP-G8 LENOVOTP-G9 LENOVOTP-GA LENOVOTP-GB LENOVOTP-GC LENOVOTP-GD LENOVOTP-GF LENOVOTP-GG LENOVOTP-GH LENOVOTP...

    JAVA虚拟机精讲

    Mark-Sweep)收集器和G1(Garbage-First)收集器)、类加载机制,以及HotSpot VM 基于栈的架构模型和执行引擎(解释器的工作流程、JIT 编译器的工作流程、分层编译策略、热点探测功能)等技术。

    Java虚拟机精讲.高翔龙.带书签完整版.pdf

    Mark-Sweep)收集器和G1(Garbage-First)收集器)、类加载机制,以及HotSpot VM 基于栈的架构模型和执行引擎(解释器的工作流程、JIT 编译器的工作流程、分层编译策略、热点探测功能)等技术。

    JAVA虚拟机精讲 pdf

    Mark-Sweep)收集器和G1(Garbage-First)收集器)、类加载机制,以及HotSpot VM 基于栈的架构模型和执行引擎(解释器的工作流程、JIT 编译器的工作流程、分层编译策略、热点探测功能)等技术。

    降低Java垃圾回收开销的5条建议

    从 serial 垃圾回收器到CMS 收集器, JVM 见证了许多 GC 实现,而 G1 将成为其下一代垃圾回收器。  随着垃圾收集器的发展,每一代 GC 与其上一代相比,都带来了巨大的进步和改善。parallel GC 与 serial GC 相比,...

    高级开发jvm面试题和答案.pdf

    对象头markword具体有什么: 对象的怎么定位,怎么通过引用找到他,有两个方法; 对象分配内存空间过程; 对象的浅克隆和深克隆; 类加载 类加载过程(类加载从磁盘上将字节码文件(.class文件)中的内容读入虚拟机,...

    jdk-14_linux-x64_bin.rpm

    通过实现 NUMA-aware 内存分配,提升 G1 在大型机器上的性能。 349:JFR Event Streaming JFR 事件流 暴露 JDK Flight Recorder 数据以进行连续监视。 352:Non-Volatile Mapped Byte Buffers 非易失性...

    2024年Java高工面试题 2024年Java高工面试题 2024年Java高工面试题

    对象组成:对象头(Mark Word、KlassPointer类型指针、数组长度)、实例数据、对齐填充(8个字节)CMS:初始标记、并发标记、重新标记、并发清理、并发重置 G1:初始标记、并发标记、最终标记、筛选回收1、spring是...

    【JVM和性能优化】2.垃圾回收器和内存分配策略

    整理算法(Mark-Compact)GC算法综合用年轻代老年代永久代枚举根节点安全点安全区域GC回收器Serial 收集器ParNew 收集器Parallel Scavenge 收集器Serial Old 收集器Parallel Old 收集器CMS 收集器G1 收集器ZGCSTW...

    JVM入门实战/arthas实战/垃圾回收算法/垃圾回收器/jvm内存模型分析

    1.5CMS(Current Mark Sweep)收集器 1.6G1收集器 第六节:JVM参数调优 1.1 JVM重要参数介绍 1.2JVM参数调优 1.3JVM参数设置思路1.4JVM调优常用指令说明 第七节:JVM项目实战 1.1案例背景 1.2排查步骤 1.3....

    java虚拟机精讲(电子工业出版社出版)

    Mark-Sweep)收集器和 G1(Garbage-First)收集器)、类加载机制,以及HotSpot VM 基于栈的架构模型和执行引擎(解释器的工作流程、JIT 编译器的工作流程、分层编译策略、热点探测功能)等技术。 第1 章 Java体系...

    Garbage-First LSM 论文

    Whole-heap operations, such as global mark- ing, are performed concurrently with mutation, to prevent interruptions proportional to heap or live-data size. Concur- rent marking both provides ...

    数据结构管道铺设课程设计含画图

    int mark[maxv]; //加入进来的点的集合 point Vert[maxv];//顶点信息 int Edge[maxv][maxv];//存放边的信息 int numV;//顶点数 int numE;//边数 int path[maxv][maxv];//每对顶点之间路劲 int dist[maxv]...

    基于德州仪AFE4490在线照护之指夹式脉冲血氧仪设计方案(含datasheet+BOM+方案叙述)-电路方案

    2.电池管理产品: BQ27425-G1 - 具有直接电池连接的系统端 Impedance Track:trade_mark: 电量监测计| 电量检测计电池 3.无线连接: CC2541 - SimpleLink Bluetooth Smart 和专利无线 MCU低功耗高性能: MSP430F5528 - ...

    C++MFC教程

    在16位的系统中系统中只有一个消息队列,所以系统必须等待当前任务处理消息后才可以发送下一消息到相应程序,如果一个程序陷如死循环或是耗时操作时系统就会得不到控制权。这种多任务系统也就称为协同式的多任务系统...

    各主板黑苹果DSDT补丁

    CF 30 Mark 2.txt Classified SR 2 270 WS W555 A1.txt Compaq 610.txt Conroe 1333 1394.txt ConRoe945G DVI.txt CQ50 113BR.txt CR400.txt CX623.txt D945GCCR.txt D945GCLF2.txt D945GCNL.txt D945GCNLBR.txt D...

Global site tag (gtag.js) - Google Analytics