Hotspot源码调试

FieldsAllocationStyle参数对对象内存布局的影

2017-09-19  本文已影响0人  过三

取值

hotspot-jdk7u40-b62\src\share\vm\runtime\globals.hpp

调试

代码

public class OopKlassTest {
    
    public int theInt;
    public long theLong;
    public String theString;
    
    public static void main(String[] args) {
        OopKlassTest oopKlassTest = new OopKlassTest();
        oopKlassTest.theInt = 10;
        oopKlassTest.theLong = 20;
        oopKlassTest.theString = "oopKlassTest";
        
        int x = 100;
        int y = 200;
        int z = 300;
    }
}

FieldsAllocationStyle=0

编译调试

FieldsAllocationStyle=1
同理FieldsAllocationStyle=1时,引用在原始类型后面

上一篇 下一篇

猜你喜欢

热点阅读