当前位置:网站首页>JVM笔记
JVM笔记
2022-06-26 15:27:00 【YMY_666】
怎么判断哪些对象需要被回收?
根可达算法,根不可达的对象没有被任何方法引用那么就说无用的对象可被回收
垃圾回收算法有哪些?
- 标记清除会清除掉垃圾对象,但会导致不连续的内存空间。
- 标记压缩不但清除掉垃圾对象还会把有用对象压缩到一块,空出连续内存空间,所以优于标记清除。
- 拷贝是清除之后将有用对象拷贝到新的区域,比如JVM
youngGC会把新生代有用对象全部拷贝到一个空的survive区然后把eden区和另一个survivor区的对象全部清除,survivor0和survivor1两个区是轮换的总有一个区是空的,每发生一次youngGC都会把一个区的幸存对象全部拷贝到另一个survive区,也是为了解决内存碎片化问题。
垃圾回收器有哪些?
Serial串行垃圾回收器,单线程进行垃圾回收,GC时会STW,业务线程全部停止等GC完了才继续,小内存还可以,大内存垃圾回收耗时会很长
CMS concurrent mark sweep并发标记扫描,为了解决STW而诞生,可以一边回收一边执行业务线程
G1
三色标记算法
自己和自己引用的对象都找到的对象被标记为黑色
自己找到但是自己引用的对象没找到的对象被标记为灰色
自己都没有被找到的对象被标记为白色
边栏推荐
- JS simple deepcopy (Introduction recursion)
- Auto Sharding Policy will apply Data Sharding policy as it failed to apply file Sharding Policy
- selenium chrome 禁用js 禁用图片
- 1. accounting basis -- several major elements of accounting (general accounting theory, accounting subjects and accounts)
- Use of abortcontroller
- [tcapulusdb knowledge base] tcapulusdb doc acceptance - transaction execution introduction
- Is it safe to open a new bond registration account? Is there any risk?
- 【微信小程序】事件绑定,你搞懂了吗?
- Using restcloud ETL shell component to schedule dataX offline tasks
- Particle filter PF -- Application in maneuvering target tracking (particle filter vs extended Kalman filter)
猜你喜欢
随机推荐
AbortController的使用
nanoPi Duo2连接wifi
canvas三个圆点闪烁动画
golang 临时对象池优化
Mr. Du said that the website was updated with illustrations
[graduation season · advanced technology Er] what is a wechat applet, which will help you open the door of the applet
PCIe Capabilities List
One click GCC script installation
[tcapulusdb knowledge base] tcapulusdb doc acceptance - create business introduction
Applicable and inapplicable scenarios of mongodb series
How to handle 2gcsv files that cannot be opened? Use byzer
Reflection modification final
Selenium saves elements as pictures
【TcaplusDB知识库】TcaplusDB单据受理-事务执行介绍
Is it safe to open a new bond registration account? Is there any risk?
CNN优化trick
Is it safe to open a stock account through the account opening link of the broker manager? Or is it safe to open an account in a securities company?
在校生学习生涯总结(2022)
Beijing Fangshan District specialized special new small giant enterprise recognition conditions, with a subsidy of 500000 yuan
【leetcode】48. Rotate image