-
Bug
-
Resolution: Unresolved
-
P4
-
None
-
24.0.2
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Tested on multiple JDKs, 17, 21, 24, 25, seems to affect all versions.
A DESCRIPTION OF THE PROBLEM :
When capturing an allocation profile, the first ObjectAllocationSample events have an incorrect weight (they are including allocations from before the start of the capture).
This seems to be a regression ofJDK-8307488, however after testing with several JDKs, I cannot find a version where it was actually fixed.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The reproducer attached to issueJDK-8307488 still reproduces the issue: https://bugs.openjdk.org/browse/JDK-8307488
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected to not see the first ObjectAllocationSample event have a such a large weight of ~2GB; it should be much lower, as well as reporting the correct class / line where the allocation occurred.
ACTUAL -
First allocation from the profile is 2GB:
jdk.ObjectAllocationSample {
startTime = 10:34:06.286 (2025-07-17)
objectClass = java.lang.Object (classLoader = bootstrap)
weight = 2.0 GB
eventThread = "main" (javaThreadId = 3)
stackTrace = [
WrongAllocationWeight.main(String[]) line: 28
]
}
It's also attributed to the wrong line / class.
---------- BEGIN SOURCE ----------
See test case / reproducer attached toJDK-8307488: https://bugs.openjdk.org/browse/JDK-8307488
---------- END SOURCE ----------
Tested on multiple JDKs, 17, 21, 24, 25, seems to affect all versions.
A DESCRIPTION OF THE PROBLEM :
When capturing an allocation profile, the first ObjectAllocationSample events have an incorrect weight (they are including allocations from before the start of the capture).
This seems to be a regression of
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The reproducer attached to issue
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected to not see the first ObjectAllocationSample event have a such a large weight of ~2GB; it should be much lower, as well as reporting the correct class / line where the allocation occurred.
ACTUAL -
First allocation from the profile is 2GB:
jdk.ObjectAllocationSample {
startTime = 10:34:06.286 (2025-07-17)
objectClass = java.lang.Object (classLoader = bootstrap)
weight = 2.0 GB
eventThread = "main" (javaThreadId = 3)
stackTrace = [
WrongAllocationWeight.main(String[]) line: 28
]
}
It's also attributed to the wrong line / class.
---------- BEGIN SOURCE ----------
See test case / reproducer attached to
---------- END SOURCE ----------