1,Java 类
- public class Math {
- public static final Integer CONSTANT = 666;
- public int math(){
- int a = 1;
- int b = 2;
- int c = (a+b) * 10;
- return c;
- }
- public static void main(String[] args) {
- Math math = new Math();
- math.math();
- }
- }
生成字节码文件 javac Math.java
2, 反汇编字节码文件 javap -c Main.class
程序计数器: 程序要执行的下一行地址指针, 线程独有.
操作数栈: 数据中转内存
动态链接:
方法出口:
方法区: JDK8 之前叫永久代, JDK8 之后叫元空间. 存放静态变量 + 常量 + 类元信息 (Math.class 类元信息)
本地方法:
本地方法栈:
堆结构
内存溢出 OOM
来源: http://www.bubuko.com/infodetail-3046223.html