fixed a bug of not getting a correct number of bytes allocated for an object when scanning a new heap