In the Type class, the size of an Object is fixed to 4 bytes. I guess this should be read from the hprof file instead (the idSize field should be used).
I'm not sure what the best way to fix this is, since moving the sizeInBytes field out of the Type enum would be a fairly significant change to the API.