measuring object size in Java

Alan Bateman Alan.Bateman at oracle.com
Fri Sep 29 06:08:06 UTC 2023



On 29/09/2023 06:54, David Holmes wrote:
> On 29/09/2023 3:38 pm, Alan Bateman wrote:
>>
>>
>> On 28/09/2023 21:42, daniel.daugherty at oracle.com wrote:
>>> java.lang.instrument is owned by the Serviceability Team so I'm 
>>> redirecting this
>>> message to that alias...
>>
>> This doesn't look like a JDK issue, instead it looks like 
>> |com.github.jelmerk.ObjectSizeFetcher has an Instrumentation field 
>> that is null. SO is a reasonable place to discuss usage issues like 
>> this although I see one of the answers about agents getting its own 
>> class loader is confusing as the agent class is loaded by the 
>> application class loader, the VM doesn't create a class loader for 
>> agents.|
>
> I guess a potential JDK issue is what has changed since 17 to cause 
> this to no longer work?

I can't think of anything. There may be more than one VM being started 
in this Maven project so it may be that the trace message to say that 
premain is called is coming from another VM, hard to tell. Needs a 
reproducer.

-Alan



More information about the serviceability-dev mailing list