`
chenchao051
  • 浏览: 137765 次
  • 性别: 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下好了,回头再仔细看看。。。

分享到:
评论

相关推荐

    三极管MARK代表型号

    这种封装下的三极管,其型号通常会被简化为一个短的MARK,包含字母和数字组合,例如"BC846A1"、"MMBT3904"等。这些MARK包含了关于三极管类型、性能和参数的信息。 1. BC846A1:这个标记中的"BC"通常表示双极型结型...

    深入理解JVM & G1 GC

    JVM提供了多种GC算法,如串行GC、并行GC、并发Mark Sweep(CMS)和G1 GC等。 G1 GC是Oracle JVM从Java 6 Update 24引入的一种新一代垃圾收集器,它的设计目标是实现可预测的暂停时间模型,即在垃圾收集过程中,能...

    G1垃圾收集器1

    相比之下,G1采用了不同的策略。 ### G1收集器的工作机制 G1将堆分割成一系列大小相等的区域(Regions),这些区域可以是Eden、Survivor或Old。这样设计的好处在于它可以避免CMS中的碎片问题,因为G1采用了标记-...

    G1垃圾回收器论文【免积分下载】

    3. **并发预清理**:G1引入了并发预清理(Concurrent Mark-Sweep)的概念,在后台持续地进行部分区域的垃圾回收工作,以减少垃圾回收带来的暂停时间。 4. **并行压缩**:当某个区域的垃圾回收完成后,G1会将存活对象...

    61-JVM之CMS收集器与G1收集器1

    本篇文章主要探讨的是两种高级垃圾收集器:CMS(Concurrent Mark Sweep)收集器和G1(Garbage-First)收集器。 CMS收集器以最小化应用程序停顿时间为目标,适用于对响应时间要求严格的互联网或B/S系统服务端。它...

    用了很多年的 CMS 垃圾收集器,终于换成了 G1,真香!!(csdn)————程序.pdf

    CMS(Concurrent Mark Sweep)垃圾收集器曾是Java HotSpot VM的主流选择,然而随着内存规模的扩大和对软实时性能需求的增长,G1(Garbage-First)垃圾收集器逐渐成为新的宠儿。G1的设计目标是实现软实时特性,即在可...

    GCViewer,Tagtraum Industries的GCviewer之叉。tagtraum在2008年停止了开发,我的目标是改进对sun/oracle的java 1.6+垃圾收集器日志(包括g1收集器)的支持。.zip

    3. **兼容性**:支持多种Java垃圾收集器的日志格式,如Serial、Parallel、Concurrent Mark Sweep (CMS) 和G1等。 4. **自定义配置**:用户可以根据需要配置不同的视图和参数,定制化分析体验。 5. **源代码开放**:...

    了解CMS(ConcurrentMarkSweep)垃圾回

    【CMS(Concurrent Mark Sweep)垃圾回收器】是Java虚拟机(JVM)中的一种垃圾收集器,专门针对老年代的内存管理。CMS回收器的主要目标是减少垃圾收集时的应用程序暂停时间,以提高用户体验。它引入了并发模式,允许...

    自己的系统的gc参数学习

    不同的JVM版本提供了多种GC实现,例如Serial、Parallel、Concurrent Mark Sweep (CMS) 和G1 (Garbage-First) 等。G1收集器是Oracle JDK 1.8引入的一种新一代的垃圾收集器,旨在提供更可预测的暂停时间,适用于大型...

    JVM的标记与STW问题1

    CMS(Concurrent Mark Sweep)和G1(Garbage First)是两种使用并发标记来提升性能的垃圾收集器。本文将深入探讨这两个收集器在处理Stop-the-World(STW)事件、标记阶段以及如何解决并发标记过程中的对象引用变更...

    jdk垃圾回收介绍

    它采用了并发标记清除(Concurrent Mark Sweep, CMS)和分代收集的组合策略,以实现高效且低延迟的内存回收。 1. **初始标记阶段**:这个阶段是暂停所有用户线程的,快速遍历根集合,标记所有可达的对象。这是为了...

    题目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 ...

    JVM性能调优-JVM内存整理及GC回收.pdf_java_jvm_

    2. **垃圾收集器选择**:根据应用需求选择合适的GC策略,例如,追求高吞吐率可以选择Parallel GC,注重响应时间则可以尝试CMS或G1。 3. **监控与诊断**:使用JVisualVM、JConsole等工具进行实时监控,分析GC日志,...

    JVM Tuning

    3. **收集方法**: 典型的收集算法包括标记-清除(Mark-Sweep)和标记-压缩(Mark-Sweep-Compact)。其中,标记-压缩算法不仅标记了可回收的对象,还整理了内存空间,减少了碎片化。 GC通常会在两种情况下被触发: - 当...

    JVM GC问题和垃圾回收器讲解.pdf

    1. CMS(Concurrent Mark Sweep)垃圾回收器: CMS是一款并发的垃圾收集器,它在大部分阶段可以与应用程序线程并发执行,减少了STW(Stop The World)的时间。CMS主要分为初始标记、并发标记、重新标记和并发清除四...

    2_JVM_3章下~5.pdf

    3. CMS(Concurrent Mark Sweep)收集器:这是一款支持并发收集的垃圾收集器,目标是尽可能缩短垃圾回收的停顿时间,适合B/S架构的服务端应用。它有四个主要步骤:初始标记、并发标记、重新标记和并发清除。CMS的...

    从ES的JVM配置起步思考JVM常见参数优化

    在过去,CMS (Concurrent Mark-Sweep) 垃圾回收器在Java 8中是一种常见选择,因为它在某些场景下能够提供较好的性能。 然而,随着Java版本的不断更新,一些旧的特性和组件被淘汰或替代,比如CMS。Java 14中正式废弃...

    细述 Java垃圾回收机制→Types of Java Garbage Collectors 1

    3. CMS(Concurrent Mark Sweep)Garbage Collector:此垃圾回收器旨在减少应用程序的暂停时间,适合响应时间敏感的应用。CMS使用多线程并发地进行大部分垃圾回收工作,仅在特定阶段暂停应用程序。它在处理大量数据...

Global site tag (gtag.js) - Google Analytics