1 Star 0 Fork 3.1K

wangbo / LearningNotes

forked from 陌溪 / LearningNotes 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
README.md 1.07 KB
Copy Edit Raw Blame History
陌溪 authored 2020-03-18 21:50 . add blog

JVM体系结构

概览

image-20200318182540332

java gc 主要回收的是 方法区 和 堆中的内容

image-20200318184401133

类加载器

  • 类加载器是什么
  • 双亲委派机制
  • Java类加载的沙箱安全机制

常见的垃圾回收算法

  • 引用计数

image-20200318184508982

在双端循环,互相引用的时候,容易报错,目前很少使用这种方式了

  • 复制

复制算法在年轻代的时候,进行使用,复制时候有交换

image-20200318184759295

image-20200318184820787

优点:没有产生内存碎片

  • 标记清除

先标记,后清除,缺点是会产生内存碎片,用于老年代多一些

image-20200318184944878

  • 标记整理

标记清除整理

image-20200318185100936

但是需要付出代价,因为移动对象需要成本

1
https://gitee.com/wbhdd/LearningNotes.git
git@gitee.com:wbhdd/LearningNotes.git
wbhdd
LearningNotes
LearningNotes
master

Search