当前位置:网站首页>JVM garbage collection overview
JVM garbage collection overview
2022-07-06 17:14:00 【Smart popcorn】
Learning with problems is more conducive to focusing our attention , I bring questions to this chapter .
1. What is rubbish ?
Simple question , But often many people can't answer , This is a misunderstanding in thinking , Well, not much bb 了 .
simply , When an object is not pointed to by any reference , Then it becomes garbage , If a person is not needed by anyone , Then he is garbage ( The example is not good , The dog's head lives ).
When there is more garbage like this , Without being cleaned up in time , It is easy to cause memory overflow .
2. Why garbage collection is needed ?
Connect with life , If the garbage is always there , So over time , The room becomes a garbage dump , Can you still live ?
The same is true for programs , Eventually, the memory is exhausted , There are only a bunch of useless objects left , Wasted resources .
And once there is garbage collection , Useless objects are cleaned up , The extra space can store new objects .
3. Early memory management
We all know ,Java There is an automatic garbage collection mechanism , This is also C,C++ What programmers envy , Because they need to make a manual memory request , Memory free , And if you forget to release , Will cause memory leaks .
What is memory leak ?
If an object has no reference, it points to , That's the useless object , But for some reason , Not recycled , This is it. Memory leak .
4. Java Automatic memory management for
The automatic garbage collection mechanism makes us Java Programmers do not need to request or free memory , But it also weakens our ability to deal with memory overflow , So it is very important for us to understand the garbage collection mechanism , We can use some monitoring or tuning tools to solve the corresponding problems .
It needs to be emphasized here ,GC and OOM Only in heap space and method area , There is no mandatory regulation on garbage collection in the method area , There are some JVM In fact, there is no garbage collection in the method area , But our default HotSpot There will still be .
Garbage recycling focuses on the new generation , Less collected in the old age , Almost immovable method area , Remember !!!
边栏推荐
- Activiti目录(五)驳回、重新发起、取消流程
- Mongodb在node中的使用
- Ruoyi-Cloud 踩坑的BUG
- 8086 内存
- 唯有学C不负众望 TOP5 S1E8|S1E9:字符和字符串&&算术运算符
- [graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.
- Activit fragmented deadly pit
- Flink 解析(四):恢复机制
- JVM之垃圾回收器下篇
- Activiti目录(四)查询代办/已办、审核
猜你喜欢

Flink 解析(四):恢复机制

Shell_ 05_ operator

arithmetic operation
![[graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.](/img/ef/2072aac5f85c7daf39174784dec7ee.jpg)
[graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.

程序员定位解决问题方法论

字节跳动春招攻略:学长学姐笔经面经,还有出题人「锦囊」

Thank you for your invitation. I'm in the work area. I just handed in the code. I'm an intern in the next ByteDance

亮相Google I/O,字节跳动是这样应用Flutter的

MySQL字符串函数

MySQL数字函数
随机推荐
QT system learning series: 1.2 style sheet sub control lookup
原型链继承
学习投资大师的智慧
8086 分段技术
Flink 解析(七):时间窗口
逻辑运算指令
Flink源码解读(二):JobGraph源码解读
The difference between URI and URL
Flink源码解读(三):ExecutionGraph源码解读
Activiti目录(五)驳回、重新发起、取消流程
Idea breakpoint debugging skills, multiple dynamic diagram package teaching package meeting.
登陆验证koa-passport中间件的简单使用
GCC error: terminate called after throwing an instance of 'std:: regex_ error‘ what(): regex
Shell_ 04_ Shell script
Fdog series (VI): use QT to communicate between the client and the client through the server (less information, recommended Collection)
字节跳动海外技术团队再夺冠:高清视频编码已获17项第一
Only learning C can live up to expectations top2 P1 variable
Notes on how the network is connected
Mongodb在node中的使用
Train 100 pictures for 1 hour, and the style of the photos changes at will. There is a demo at the end of the article | siggraph 2021