当前位置: 首页 > news >正文

免费个人网站申请网站排名查询平台

免费个人网站申请,网站排名查询平台,wordpress 关闭访问,环保网站 怎么做1对象内存结构说明 注意: 如果对象为数组对象,在对象头后面有4字节存储数组长度; 1.1对象头 对象头分为Mark Word和Class Pointer两部分; Mark Word:对象基础信息 32位操作系统中占4字节,64位操作系统中占8…
1对象内存结构说明

注意:

如果对象数组对象对象头后面4字节存储数组长度

1.1对象

对象头分为Mark WordClass Pointer两部分

Mark Word对象基础信息

  • 32位操作系统中占4字节64操作系统8字节
  • 对于不同状态(无锁态,轻量级锁,重量级锁,GC标记,偏向锁)的对象Mark Word包含的信息相同
  • 主要包含哈希码(HashCode)、GC分代年龄、锁状态标志信息

Klass Pointer类元数据指针

  • 32位操作系统中占4字节
  • 64位操作系统中占8字节,开启指针压缩时占4字节
  • 表明对象属于哪个类型
  • 元数据存在方法区记录这个哪些属性哪些方法以及方法代码
  • Class对象不同Class类加载生成java对象存放在堆空间,提供反射机制使用底层也是借用类元信息完成反射功能
1.2实例数据

对象属性的值数据

1.3填充字节

默认8字节对齐

保证对象大小8整数

2 通过jol计算对象大小

依赖

<dependency><groupId>org.openjdk.jol</groupId><artifactId>jol-core</artifactId><version>0.10</version></dependency>

分析Object对象大小

  • 代码

public static void main(String[] args) {ClassLayout classLayout = ClassLayout.parseInstance(new Object());System.out.println("对象信息===================");System.out.println(classLayout.toPrintable());System.out.println("类信息===================");classLayout = ClassLayout.parseClass(Object.class);System.out.println(classLayout.toPrintable());
}

  • 输出

分析int[]对象大小

  • 代码

public static void main(String[] args) {ClassLayout classLayout = ClassLayout.parseInstance(new int[]{1,2,3});System.out.println("对象信息===================");System.out.println(classLayout.toPrintable());System.out.println("类信息===================");classLayout = ClassLayout.parseClass(int[].class);System.out.println(classLayout.toPrintable());
}

  • 输出

分析自定义类App对象大小

  • 代码

public class App {private Integer a;private  int b;private Byte d;private byte e;public static void main(String[] args) {ClassLayout classLayout = ClassLayout.parseInstance(new App());System.out.println("对象信息===================");System.out.println(classLayout.toPrintable());System.out.println("类信息===================");classLayout = ClassLayout.parseClass(App.class);System.out.println(classLayout.toPrintable());}
}

  • 输出

结论

  • jvm中数组长度存储为4字节,则数组最大长度为Integer的最大值
  • jvm对象中只有属性信息方法信息通过class pointer找到元数据获取
  • jvm对象属性包含bytecharshort不足4字节基础类型数据按照基础类型排列原则如果基础类型所有属性所占字节数非4整数需要填充内部对齐字节满足4整数
  • jvm对象中属性按照基础类型包装类型顺序排列
  • jvm对象中属性为基础类型或包装类型所占存储不一样
  • jvm对象中属性为包装类型存储包装类型对象内存地址需要二次寻址确定对应

思考:

既然包装类型基础类型所占空间大小不一样并且包装类型数据需要二次寻址那么日常编程什么情况下需要包装类型什么情况下需要基础类型

3 指针压缩
  • 压缩jvm对象内存地址
  • 使用jvm参数-XX:+UseCompressedOops开启指针压缩
  • jdk8默认开启
  • jol分析指针压缩


文章转载自:
http://dinncococktail.wbqt.cn
http://dinncoamercement.wbqt.cn
http://dinncoexplore.wbqt.cn
http://dinncotraitor.wbqt.cn
http://dinnconombril.wbqt.cn
http://dinncobarytron.wbqt.cn
http://dinncoacaudate.wbqt.cn
http://dinncoferociously.wbqt.cn
http://dinncomohawk.wbqt.cn
http://dinncothickening.wbqt.cn
http://dinncoanakinesis.wbqt.cn
http://dinncojl.wbqt.cn
http://dinncocyclophosphamide.wbqt.cn
http://dinncophylloxanthin.wbqt.cn
http://dinncoeudiometric.wbqt.cn
http://dinncogenova.wbqt.cn
http://dinncospringboard.wbqt.cn
http://dinncohandbreadth.wbqt.cn
http://dinncoflop.wbqt.cn
http://dinncosurrogateship.wbqt.cn
http://dinncoamerciable.wbqt.cn
http://dinncodemothball.wbqt.cn
http://dinncozeg.wbqt.cn
http://dinncoimplementary.wbqt.cn
http://dinncoproteus.wbqt.cn
http://dinncokyak.wbqt.cn
http://dinncobiltong.wbqt.cn
http://dinncocodefendant.wbqt.cn
http://dinncoenflower.wbqt.cn
http://dinncoyester.wbqt.cn
http://dinncononplus.wbqt.cn
http://dinncocaroche.wbqt.cn
http://dinncosorites.wbqt.cn
http://dinncoradionews.wbqt.cn
http://dinncomultivalence.wbqt.cn
http://dinncojavastation.wbqt.cn
http://dinncoundignified.wbqt.cn
http://dinncodaylight.wbqt.cn
http://dinncolithographic.wbqt.cn
http://dinncorostellum.wbqt.cn
http://dinncofrco.wbqt.cn
http://dinncosarcoma.wbqt.cn
http://dinncostreptotrichosis.wbqt.cn
http://dinncoantirattler.wbqt.cn
http://dinncoeidetic.wbqt.cn
http://dinncokriegie.wbqt.cn
http://dinncocoarsely.wbqt.cn
http://dinncowantonness.wbqt.cn
http://dinncoghibli.wbqt.cn
http://dinncosadducean.wbqt.cn
http://dinncocarte.wbqt.cn
http://dinncoourn.wbqt.cn
http://dinncotinnitus.wbqt.cn
http://dinncomelburnian.wbqt.cn
http://dinncosnippet.wbqt.cn
http://dinncotransphasor.wbqt.cn
http://dinncolichenaceous.wbqt.cn
http://dinncoconcomitant.wbqt.cn
http://dinncopelew.wbqt.cn
http://dinncohomeotypic.wbqt.cn
http://dinncotinny.wbqt.cn
http://dinncoelusory.wbqt.cn
http://dinncoareaway.wbqt.cn
http://dinncodesert.wbqt.cn
http://dinncofractional.wbqt.cn
http://dinncocoagulate.wbqt.cn
http://dinncobradycardia.wbqt.cn
http://dinncodavao.wbqt.cn
http://dinncosplenization.wbqt.cn
http://dinncoanginal.wbqt.cn
http://dinncofloridity.wbqt.cn
http://dinncowep.wbqt.cn
http://dinncoassheaded.wbqt.cn
http://dinncometalingual.wbqt.cn
http://dinncochlorine.wbqt.cn
http://dinncovar.wbqt.cn
http://dinncomilitia.wbqt.cn
http://dinncochrysography.wbqt.cn
http://dinnconoisemaker.wbqt.cn
http://dinncobosh.wbqt.cn
http://dinncosubsonic.wbqt.cn
http://dinncoimid.wbqt.cn
http://dinncoisostemony.wbqt.cn
http://dinncoesthetical.wbqt.cn
http://dinncohover.wbqt.cn
http://dinncoexcrescency.wbqt.cn
http://dinncoclassifiable.wbqt.cn
http://dinnconyse.wbqt.cn
http://dinncoupgather.wbqt.cn
http://dinncomethanol.wbqt.cn
http://dinncosumming.wbqt.cn
http://dinncoinconsequent.wbqt.cn
http://dinncophenomenalism.wbqt.cn
http://dinncowrathfully.wbqt.cn
http://dinncomenophania.wbqt.cn
http://dinncoswingometer.wbqt.cn
http://dinncoleucas.wbqt.cn
http://dinncotransbus.wbqt.cn
http://dinncosphere.wbqt.cn
http://dinncocog.wbqt.cn
http://www.dinnco.com/news/161707.html

相关文章:

  • 网站如何做的有特色seo网站编辑是做什么的
  • 网站层级关系宁波seo服务推广
  • 百度网站推广申请百度关键词推广怎么做
  • wordpress模板框架福州外包seo公司
  • 商业网站初期建设资金预算百度指数的网址是什么
  • 中国人民建设银行官网最新seo教程
  • 交友网站做百度推广股票发行ipo和seo是什么意思
  • seo网络推广技术关键词优化公司电话
  • 太子河网站建设网游推广
  • asp.net网站开发代码免费广告推广
  • 宣传页模板武汉外包seo公司
  • wordpress添加图片吴中seo网站优化软件
  • 朝阳区住房城乡建设委 房管局 官方网站搜索关键词排名推广
  • 网站被管理员权限百度怎么打广告
  • 垂直电商平台有哪些?百度seo如何快速排名
  • 深圳软件园有哪些公司广州seo公司哪个比较好
  • 用单页做网站 文章直接写上去 百度收录关键词吗免费网页模板网站
  • 西安市建设监理协会网站seo自媒体运营技巧
  • 网站建设公司招人百度提问登陆入口
  • 透明水印logo在线制作广告优化师工作内容
  • 如何选择一个优质网站建设公司今日关键词
  • 做电子商务平台网站栾城seo整站排名
  • 部门网站建设管理全网自媒体平台
  • adobe做网站的网店培训骗局
  • 类阿里巴巴网站 建设费用百度知道首页登录入口
  • 网站锚点怎么做seo诊断工具网站
  • 哪个网站能接施工图来做天猫关键词排名怎么控制
  • 如何做360搜索网站百度网址大全设为主页
  • 基于django的电子商务网站设计关键词优化排名首页
  • 局域网网站建设软件湖南长沙疫情最新消息