RFR 8231146: Heap object size

Frederic Parain frederic.parain at oracle.com
Tue Sep 17 21:41:33 UTC 2019


Tested with inline class instances, inline class arrays and Java mirrors.
Seems to work well.

As discussed off-line, this API only provides the size occupied when allocated
in the Java heap. Sizes of a flattened field or an array element for the same
inline class can be different.

Ship it!

Fred


> On Sep 17, 2019, at 16:00, Roger Riggs <Roger.Riggs at Oracle.com> wrote:
> 
> Please review and comment:
> 
> This request adds a (probably temporary) API to return the heap size of an object.
> 
> In prototyping with inline classes it will be useful to know an approximation of the size of an object in the heap while prototyping various tradoffs in performance and data structures.
> 
> 
> Webrev:
> 
>   http://cr.openjdk.java.net/~rriggs/webrev-object-size-8231146/
> 
> Thanks, Roger
> 



More information about the valhalla-dev mailing list