GitHub -> DajinPang

Men just want to be hard !

JVM中的垃圾收集

引用计数(Reference Counting) 

循环引用问题

标记­清除(Mark and Sweep)

内存池(Memory Pools) 

Eden 是内存中的一个区域, 用来分配新创建的对象 。存活区(Survivor Spaces)Eden 区的旁边是两个存活区, 称为 from 空间 to 空间 。需要着重强调的的是, 任意时刻总有一个存活区是空

(empty)

Full GC(完全GC)清理的是整个堆, 包括年轻代和老年代空间。


 

GC 算法

各种GC算法在删除不可达对象时略有不同, 但总体可分为三类: 清除(sweeping)、整理(compacting)和复制
(copying)

年轻代和老年代的串行GC(Serial GC)
年轻代和老年代的并行GC(Parallel GC)
年轻代的并行GC(Parallel New) + 老年代的CMS(Concurrent Mark and Sweep)
G1, 负责回收年轻代和老年代



GC 调优(基础篇)

 

1. 列出性能调优指标(State your performance goals)
2. 执行测试(Run tests)
3. 检查结果(Measure the results)
4. 与目标进行对比(Compare the results with the goals)
5. 如果达不到指标, 修改配置参数, 然后继续测试(go back to running tests)

GC性能指标 :

Latency(延迟)
Throughput(吞吐量)
Capacity(系统容量)

 

posted @ 2019-05-08 22:51  StevenPang  阅读(301)  评论(0编辑  收藏  举报