当前位置:网站首页>对象内存布局
对象内存布局
2022-07-01 21:43:00 【键盘歌唱家】
一、简介
在HotSpot虚拟机里,对象在堆内存中的存储布局可以划分为三个部分:对象头(Header)、实例数据(Instance Data)和对齐填充(Padding)。其中对其填充是为了保证对象是8字节的倍数!
其中对象头可以再次进行细分,分为对象标记(Mark Word) 和类元信息(类型指针),对于数组对象来说对象头又会多一个Length部分。在64位系统中,Mark Word占了8个字节,类型指针占了8个字节,一共是16个字节。
从openJDK的oop.hpp源码中可以看到:_mark字段是mark word,_metadata是类指针klass pointer,对象头(object header)即是由这两个字段组成.
二、对象头之MarkWord
可以发现哈希码、GC标记,GC次数,同步锁标记,偏向锁持有者都在Mark Word里面.
这些信息都是与对象自身定义无关的数据,所以Mar
边栏推荐
猜你喜欢

100年仅6款产品获批,疫苗竞争背后的“佐剂”江湖

Training on the device with MIT | 256Kb memory

名单揭晓 | 2021年度中国杰出知识产权服务团队

Business visualization - make your flowchart'run'up

List announced | outstanding intellectual property service team in China in 2021

基于K-means的用户画像聚类模型

Application of real estate management based on 3D GIS

【商业终端仿真解决方案】上海道宁为您带来Georgia介绍、试用、教程

首席信息官对高绩效IT团队定义的探讨和分析

Yan Rong looks at how to formulate a multi cloud strategy in the era of hybrid cloud
随机推荐
【智能QbD风险评估工具】上海道宁为您带来LeanQbD介绍、试用、教程
MQ学习笔记
plantuml介绍与使用
Flume面试题
Electron学习(三)之简单交互操作
String类型转换BigDecimal、Date类型
Airserver mobile phone third-party screen projection computer software
PCB plug hole technology~
基于YOLOv5的口罩佩戴检测方法
What is the difference between PMP and NPDP?
Burpsuite simple packet capturing tutorial [easy to understand]
游览器打开摄像头案例
MySQL系列之事务日志Redo log学习笔记
Application of real estate management based on 3D GIS
Sonic云真机学习总结6 - 1.4.1服务端、agent端部署
微软、哥伦比亚大学|GODEL:目标导向对话的大规模预训练
按照功能对Boost库进行分类
Use of vscode
Pytest collection (2) - pytest operation mode
I received a letter from CTO inviting me to interview machine learning engineer