Skip to content

Commit dc725e3

Browse files
committed
分代回收算法
1 parent 0f850d7 commit dc725e3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

MD/GarbageCollection.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
- 清楚之后容易出现不连续内存,当需要分配一个较大内存时就不得不需要进行一次垃圾回收。
3838

3939
标记清除过程如下:
40+
4041
![](https://ws3.sinaimg.cn/large/006tNc79gy1fmz99ai1n3j30fj08qdgc.jpg)
4142

4243
### 复制算法
@@ -50,6 +51,7 @@
5051
新生代中分为一个 `Eden` 区和两个 `Survivor` 区。通常两个区域的比例是 `8:1:1` ,使用时会用到 `Eden` 去和其中一个 `Survivor` 区。当发生回收时则会将还存活的对象从 Eden ,Survivor 区拷贝到另一个 Survivor 区。当该区域内存也不足时候则会使用分配担保使用永久代来存放内存。
5152

5253
复制算法过程:
54+
5355
![](https://ws3.sinaimg.cn/large/006tNc79gy1fmzavlf4enj30fj08qt9b.jpg)
5456

5557

0 commit comments

Comments
 (0)