RFR: CODETOOLS-7903262: JOL: GraphStatsWalker counts array elements incorrectly

Vladimir Plizga duke at openjdk.org
Sat Aug 27 18:26:05 UTC 2022


#### Observed behavior
Current `GraphStatsWalker` implementation does not count size and quantity of objects directly contained in arrays.

#### Desired behavior
The `totalSize()` and `totalCount()` methods of a `GraphStats` instance should return the same values as the ones of `GraphLayout` instance built for the same object.

#### Additional info
There is a [simple unit test](https://gist.github.com/Toparvion/adec9052ad23e85e54d72b5bfb5a1aa3) that can be used to reproduce current behavior without checking out the fix branch.

-------------

Commit messages:
 - Rename test method for GraphStatsWalker
 - Count sizes of arrays' object elements in GraphStatsWalker

Changes: https://git.openjdk.org/jol/pull/33/files
 Webrev: https://webrevs.openjdk.org/?repo=jol&pr=33&range=00
  Issue: https://bugs.openjdk.org/browse/CODETOOLS-7903262
  Stats: 19 lines in 2 files changed: 19 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jol/pull/33.diff
  Fetch: git fetch https://git.openjdk.org/jol pull/33/head:pull/33

PR: https://git.openjdk.org/jol/pull/33


More information about the jol-dev mailing list