Earlier versions of supported Java 6 -XX:+UseCompressedOops , but this was disabled by default. (The first versions of Java 6 did not support this at all) This means that the links in the 64-bit JVM were 64-bit. The new JVM uses a 32-bit link if the heap is <32 GB. He can do this, since obejcts are 8-byte aligned, so you can address 2 ^ 32 * 8 bytes with a 32-bit link.
Note: US_ASCII inherits three fields from Charset.
private final String name;
These links are reduced by 4 bytes, saving 12 bytes, however objects are aligned by 8 bytes, so the total storage is 16 bytes.
Using compressed oops reduces the amount of memory used.
Compress oops in JVM Hotspot
BTW: you would not use this class directly, instead you would use StandardCharset.US_ASCII
source share