Skip to content

Heap dump viewer: compute object size with compressed references #399

@christianwimmer

Description

@christianwimmer

Is your feature request related to a problem? Please describe.
The hprof format for heap dumps does not contain object layout information from the VM that produced the dump. So the heap dump viewer needs to do a best guess for object and array sizes. For references (pointers between Java objects), the best guess is always that a reference is 8 byte. But most heaps below 32 GByte use compressed references, i.e., a reference is only 4 byte. That overstates the size especially for object arrays, which are all reported as twice the size they really occupy. For instances the problem is less severe, but they are still overestimated a good bit.

Describe the solution you'd like
Allow a configuration option to compute object sizes with compressed references. That can be done

  1. either as a toggle button in the actual heap dump viewer,
  2. or as a preference that then affects all heap dump views.

The first option makes it more obvious to the user, the second is probably easier to implement because it does not require immediate re-calculation of all sizes that are already displayed.

Describe alternatives you've considered
Currently users need to be aware that their object sizes are too large, and manually divide array sizes by 2.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions