On Wed, 21 Oct 2026 01:39:57 GMT, Leonid Mesnik <[email protected]> wrote:

>> The SampledObjectAlloc event is called before object is cloned. It might 
>> potentially cause the issues because Clone() implementation might rely on 
>> the fact that object is not updated before creation an updating by clone. 
>> 
>> The proposed fix is to call SampledObjectAlloc after clone is completed like 
>> it is done for VMObjectAlloc. Thus clone is atomic and can't be interrupted 
>> by Java code.
>> 
>> The JVMTI specification is not specific to the exact time when the event is 
>> called. 
>> 
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Leonid Mesnik has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   the fix

test/hotspot/jtreg/serviceability/jvmti/events/SampledObjectAlloc/SampledObjecAfterCloning/SampledObjecAfterCloningTest.java
 line 25:

> 23: 
> 24: /*
> 25:  * @test id=Z

This doesn't seem to be a ZGC test

test/hotspot/jtreg/serviceability/jvmti/events/SampledObjectAlloc/SampledObjecAfterCloning/SampledObjecAfterCloningTest.java
 line 27:

> 25:  * @test id=Z
> 26:  * @bug 8383787
> 27:  * @summary Test verifies that SampledObjectAlloc event is called with 
> after clone().

> called with after clone

maybe just 'called after clone'?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33483#discussion_r4338302682
PR Review Comment: https://git.openjdk.org/jdk/pull/33483#discussion_r4338311119

Reply via email to