How to detect if the VM is running with compact refs from within the VM (no agent)?
Krystal Mok
rednaxelafx at gmail.com
Wed Mar 14 11:13:04 PDT 2012
Couldn't find these two fields in sun.misc.Unsafe (in JDK6u30), found
arrayIndexScale(Class) and addressSize() methods instead.
Experiment: https://gist.github.com/2038305
Works as advertised. Thanks John! Learning new bits everday for me, too :-)
- Kris
On Thu, Mar 15, 2012 at 1:53 AM, John Rose <john.r.rose at oracle.com> wrote:
> On Mar 14, 2012, at 1:41 AM, Krystal Mok wrote:
>
> I'm not aware of any way to get the exact "reference size" (or "oop size"
> in HotSpot's terms). But it's possible to know whether compressed oops is
> in use or not.
>
>
> For some platforms, you could inspect
> sun.misc.Unsafe.ARRAY_OBJECT_INDEX_SCALE (= oopSize) and ADDRESS_SIZE (=
> wordSize).
>
> — John
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20120315/5494748f/attachment.html
More information about the hotspot-compiler-dev
mailing list