Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
haneefmubarak
on July 11, 2016
|
parent
|
context
|
favorite
| on:
Allocation on the JVM: Down the rabbit hole
So... Why exactly does it need 24 bytes if a long is only 8 bytes (64 bits)?
kaushiks
on July 11, 2016
[–]
For the 16 byte (on x86_64) header (markOop, klass *).
jcdavis
on July 12, 2016
|
parent
[–]
The header is only 12 bytes with compressedOops (which most people use), but the long is aligned on an 8 byte boundary so the advantage is wasted here.
alblue
on July 12, 2016
|
root
|
parent
[–]
And even if the long wasn't on an aligned boundary, the object itself is. So you either have padding at the start or end of the object.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: