This is the only answer.
Java is intended to be right once, run anywhere. "Anywhere" will include 32 bit address spaces for the forseeable future.
Java is intended to be right once, run anywhere. "Anywhere" will include 32 bit address spaces for the forseeable future.
See also: X32.
Could you explain how this works?
Same for any other size. Got 32 bit address space, 4GB? Well with 4 byte alignment, you shave off two bits, just multiply every pointer by 4 (left shift it by 2).
With the two highest bits, you're free to encode other information for whatever little things you need to keep track of in the runtime.
The JVM already does this on x64 so that instead of 8 byte pointers, they're only 4 bytes. But alignment bumps up the range from 4 to 16(?) GB - or something like that? Compresssed object pointers I think is the name if you wanna look up more.