java.lang.String

It is big problem in java. You have pointer to String object with fields: hashCode and chars array (UTF-16). But every array is object itself. So it is pointer to object again. There is pointer compression option in x64 JVM (it uses 32 bits per pointer), but in any way it is too many indirection and additional overhead for object headers.

FYI
It is possible that Java 9 will have value types (google: IBM Java PackedObjects)

Reply via email to