1 jvm的位置及体系结构
2 类加载器
3 native
4 pc和方法区
5 堆内存调优
(元空间 相当于在本地内存中 逻辑上在堆 名字叫非堆)
堆内存计算:
6 jprofile工具分析oom原因
1 首先需要安装jprofile工具 之间官网下载最新版 并破解注册码即可
2 安装jprofile插件 并且在settings中的tool中 进行jprofile软件的路径匹配
3 写一段错误代码 然后jvm参数 进行运行调错:
package jvm;
import java.util.ArrayList;
public class jprofile {
byte[] bytes=new byte[1024*1024];
public static void main(String[] args) {
ArrayList<jprofile> list = new ArrayList<>();
int count=0;
try {
while (true){
list.add(new jprofile());
count++;
}
}catch (Exception e){
e.printStackTrace();
}
}
}
4 最后就可以在jprofile工具中看到自己的代码问题了
ps:狂神的关键笔记
7 Gc算法
为什么新生代内存需要有两个Survivor区?