RFR: 8289745: JfrStructCopyFailed uses heap words instead of bytes for object sizes

Ralf Schmelter rschmelter at openjdk.org
Mon Jul 11 12:11:41 UTC 2022


On Wed, 6 Jul 2022 13:36:26 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> The values for smallestSize, firstSize and totalSize in the CopyFailed type are set as the number of heap words, but should be number of bytes. This leads to wrong values in the PromotionFailed and EvacuationFailed JFR events containing this type.
>
> test/jdk/jdk/jfr/event/gc/detailed/PromotionFailedEvent.java line 56:
> 
>> 54:             System.out.println("Event: " + event);
>> 55:             long smallestSize = Events.assertField(event, "promotionFailed.smallestSize").atLeast(1L).getValue();
>> 56:             Asserts.assertTrue((smallestSize % minObjectAlignment) == 0, "smallestSize " + smallestSize + " is not a valid size.");
> 
> Testing for alignment is a good pragmatic way to check for regressions without adding more logic.
> 
> Do the numbers include object headers? If yes, we could assert to >= 8 at least.

Yes, the header is included. It is the size we would use if we iterate over a contiguous region the heap. We check that the size is > 0 in the assert above, so it has to be at least 8.

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

PR: https://git.openjdk.org/jdk/pull/9378


More information about the hotspot-dev mailing list