How to detect if the VM is running with compact refs from within the VM (no agent)?
rednaxelafx at gmail.com
Wed Mar 14 02:42:03 PDT 2012
For product releases of Oracle/Sun JDK:
The option -XX:+UseCompressedOops became available from around JDK6u14 .
Before 6u23, the option has to be explicitly set on the command line or
from a config file (.hotspotrc) in order to use compressed oops.
>From 6u23 and on, the ergonomics in HotSpot VM will automatically enable
UseCompressedOops when the whole GC heap is less than around 32GB and G1GC
is not in use. 7017008  removed the G1GC limitation, and was delivered
in JDK7 (but not in any of the released JDK6 versions).
On Wed, Mar 14, 2012 at 4:44 PM, Dawid Weiss <dawid.weiss at gmail.com> wrote:
> Thanks Kris!
> I thought about parsing command-line but I wasn't sure about the
> runtime -- can it switch to compressed OOPS on its own (or rather: is
> there a heuristic to switch to compressed OOPS or is it always full
> refs in 64 bit mode unless an explicit command line option's been
> > You could use HotSpotDiagnosticMXBean via JMX to get VM options. An
> > here .
> > If you're trying to get this information from the command line, use:
> > jinfo -flag UseCompressedOops <pid>
> > HTH,
> > - Kris
> > : https://gist.github.com/1333043
> > On Wed, Mar 14, 2012 at 4:30 PM, Dawid Weiss <dawid.weiss at gmail.com>
> >> Hi everyone,
> >> This has been asked on Apache Lucene JIRA and I admit I don't know the
> >> answer:
> >> Is there a way to detect the reference size (which boils down to
> >> compact vs. full reference on 64 bit machines) from within Java?
> >> I assume the VM starts without an agent so Instrumentation is not
> >> available. I'd appreciate a comment if somebody knows right away (even
> >> if it's a: "no"), otherwise I'll go through the sources and try to
> >> figure it out on my own.
> >> Thanks,
> >> Dawid
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-compiler-dev