`

Java垃圾回收—— concurrent collector

    博客分类:
  • JVM
阅读更多

With the serial collector a major collection is started when the tenured generation becomes full and all application threads are stopped while the collection is done. In contrast a concurrent collection should be started at a time such that the collection can finish before the tenured generation becomes full. There are several ways a concurrent collection can be started.

 

The concurrent collector keeps statistics on the time remaining before the tenured generation is full (T-until-full) and on the time needed to do a concurrent collection (T-collect). When the T-until-full approaches T-collect, a concurrent collection is started. This test is appropriately padded so as to start a collection conservatively early.

A concurrent collection will also start if the occupancy of the tenured generation grows above the initiating occupancy (i.e., the percentage of the current heap that is used before a concurrent collection is started). The initiating occupancy by default is set to about 68%. It can be set with the parameter CMSInitiatingOccupancyFraction which can be set on the command line with the flag

-XX:CMSInitiatingOccupancyFraction=<nn>

The value <nn> is a percentage of the current tenured generation size.

 

分享到:
评论

相关推荐

    深入Java核心_探秘Java垃圾回收机制

    ### 深入Java核心探秘Java垃圾回收机制 #### 一、引言 Java作为一种广泛应用的编程语言,其强大的自动内存管理和垃圾回收机制一直是开发者关注的焦点。垃圾回收(Garbage Collection, GC)能够自动识别和清理不再...

    Java入门--简述Java语言回收机制

    与C++等需要手动管理内存的语言不同,Java通过内置的垃圾回收器(Garbage Collector, GC)自动管理对象的生命周期,简化了内存管理的同时也提高了程序的安全性和稳定性。 #### 二、垃圾回收的基本概念 1. **什么是...

    java入门、java内存区域和OOM、垃圾回收器和垃圾回收策略

    常见的垃圾回收器有Serial、Parallel、CMS(Concurrent Mark Sweep)、G1(Garbage-First)和ZGC(Z Garbage Collector)等。 - **垃圾回收策略**:包括标记-清除、复制、标记-整理和分代收集等。这些策略各有优...

    Java垃圾收集器参考.pdf

    Java虚拟机(JVM)中的垃圾收集器通过一个低优先级的线程——垃圾收集器线程来监控和回收不再使用的对象所占用的内存。 1. **内存管理自动化**:Java垃圾收集器的目标是自动识别并回收那些不再被程序中任何“活动...

    30+个视频+深入理解Java虚拟机(jvm优化+内存模型+虚拟机原理)

    JVM提供了一套自动内存管理系统——垃圾回收器(Garbage Collector),用于跟踪不再使用的对象并释放其占用的内存空间。常见的垃圾回收算法包括标记-清除算法、复制算法、标记-整理算法等。不同版本的JVM可能会采用...

    对象的释放和垃圾收集机制.txt

    3. **Concurrent Mark Sweep (CMS) Collector**:旨在最小化停顿时间,适合交互式应用。 4. **G1 Collector**:目标是最小化停顿时间的同时提供高吞吐量,适用于大堆内存的应用。 #### 五、总结 无论是手动管理...

    王者归来之java面试题大全最新经典-葵花宝典.rar

    《王者归来之Java面试题大全最新经典——葵花宝典》是针对Java程序员面试的一份综合性的学习资料,由IT教学总监单兴华编撰。这份文档旨在帮助Java开发者准备面试,涵盖了大量的Java核心技术以及面试常见问题,是提升...

    jvm详解资料

    - **JVM的垃圾收集策略**:现代JVM提供了多种垃圾收集器,如串行收集器(Serial Collector)、并行收集器(Parallel Collector)、并发标记-清扫收集器(Concurrent Mark-Sweep Collector)等,每种收集器都针对不同...

    JDK11文档 jdk-11.0.4 API文档

    6. **强引用集合**:`java.util.concurrent`包新增了`StrongReferenceQueue`,这是一个基于强引用的队列,可以用于实现对象池或者垃圾回收策略。 7. **ZGC(Z Garbage Collector)**:JDK11引入了ZGC,这是一种低...

    javajdk源码学习-JavaResources:jdk源码学习

    接下来是Java内存管理的部分,主要关注垃圾收集器(Garbage Collector, GC)。JVM(Java Virtual Machine)负责内存分配和回收,通过源码我们可以理解不同GC策略的工作原理,如Serial、Parallel、CMS(Concurrent ...

    JDK7.0新特性

    3. **垃圾回收器优化**:引入了一个新的垃圾回收器——Garbage-First Collector (G1),旨在替换 Concurrent Mark-Sweep Collector (CMS)。G1 收集器通过减少停顿时间和提高吞吐量来改善应用性能。 4. **Java ...

Global site tag (gtag.js) - Google Analytics