|
To clarify the situation with J9, with a silly test program I wrote, the hash values have a remainder of 0 or 2 when divided by 4.
We and Sun have a reasonably even distribution of 0 1 2 and 3 If they were just returning addresses we would expect always 0. For info: hash % x = 0 / 1 / 2 / 3 |
||||||||||||||||||||||||||||||||||||||||||
Our address based hashing function is
ADDRESS >>> LOG_BYTES_IN_ADDRESS
As we sometimes 8 byte align objects, the distribution of our hash will be uneven and give more even numbers than odd..
We should improve it by making it:
ADDRESS >>> LOG_MAX_ALIGNMENT
where LOG_MAX_ALIGNMENT is currently 8 for intel I believe.
J9 appears to have made a similar mistake in that all values are even. Perhaps they didn't keep their hash in sync with their minimum alignment?