Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You generally need to reserve at least a pointer sized block of memory for a Java object because they can be used as locks with the sychronized keyword. Very few objects ever get used as a lock, so they make use of the bytes for other things like the hash.

Of course, that does imply the synchronized keyword has a fairly substantial memory cost.



Agree. Everything built-in to every object is a recipe for overhead.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: