使用JOL查看对象布局

 

[main] INFO com.crazymakercircle.threadpool.SeqOrScheduledTargetThreadPoolLazyHolder - 线程池已经初始化
[InnerLockTest.showNoLockObject]:# Running 64-bit HotSpot VM.
# Using compressed oop with 3-bit shift.
# Using compressed klass with 3-bit shift.
# Objects are 8 bytes aligned.
# Field sizes by type: 4, 1, 1, 2, 2, 4, 4, 8, 8 [bytes]
# Array element sizes: 4, 1, 1, 2, 2, 4, 4, 8, 8 [bytes]

[InnerLockTest.showNoLockObject]:object status: 
[ObjectLock.printSelf]:lock hexHash= d6 32 65 09 
[ObjectLock.printSelf]:lock binaryHash= 11010110 00110010 01100101 00001001 
[ObjectLock.printSelf]:lock = com.crazymakercircle.innerlock.ObjectLock object internals:
 OFFSET  SIZE                TYPE DESCRIPTION                               VALUE
      0     4                     (object header)                           01 d6 32 65 (00000001 11010110 00110010 01100101) (1697830401)
      4     4                     (object header)                           09 00 00 00 (00001001 00000000 00000000 00000000) (9)
      8     4                     (object header)                           a3 13 01 f8 (10100011 00010011 00000001 11111000) (-134147165)
     12     4   java.lang.Integer ObjectLock.amount                         0
Instance size: 16 bytes
Space losses: 0 bytes internal + 0 bytes external = 0 bytes total

JVM退出钩子(定时和顺序任务线程池) starting.... 
JVM退出钩子(定时和顺序任务线程池)  耗时(ms): 0

 

posted @ 2025-09-27 17:28  SpongeBob~  阅读(8)  评论(0)    收藏  举报