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

You can't distinguish them at runtime from each other.

Your memory consumption is higher, because type erasure requires elementary types to be boxed. Since the boxed value is itself allocated somewhere else, there's indirection. Indirection means CPU stalls. Another consequence is data cache pollution. There are just 512 of 64 byte L1D cache lines.

Other than that, I guess nothing.



But if you're worried about that amount of memory consumption, why are you using Java? If you need that much control over memory, Java may not be the language for you.

Ditto if you're worried about the performance hit from cache misses.




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

Search: