LoginSignup
0
0

More than 3 years have passed since last update.

Javaのオブジェクトのサイズ感

Last updated at Posted at 2020-01-01

Javaのオブジェクトのサイズ。間違いもありそう。

  • reference
    • 4byte (32bit JVM or heapが32GB未満の64bit JVM)
    • 8byte (heapが32GB以上の64bit JVM)
  • Object
    • 12byte (heapによらず)
  • Array
    • 12byte (32bit JVM or heapが32GB未満の64bit JVM)
    • 24byte(heapが32GB以上の64bit JVM)

ただし,オブジェクトのサイズは8byteの倍数になるようにパディングされるので,オブジェクトの最小サイズは16byte

参考:Javaパフォーマンス, p.202

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0