"product rw" vs "manageable"

Srinivas Ramakrishna ysr1729 at gmail.com
Tue Jul 25 22:35:10 UTC 2017

Today I had occasion to want to switch on what I thought was a "manageable"
flag in a running JVM (TraceClass{Unl,L}oading), and I found that the flags
were declared "product_rw" which is documented as:

// product_rw flags are writeable internal product flags.
//    They are like "manageable" flags but for internal/private use.
//    The list of product_rw flags are internal/private flags which
//    may be changed/removed in a future release.  It can be set
//    through the management interface to get/set value
//    when the name of flag is supplied.
//    A flag can be made as "product_rw" only if
//    - the VM implementation supports dynamic setting of the flag.
//      This implies that the VM must *always* query the flag variable
//      and not reuse state related to the flag state at any given time.

I assumed this just meant that the flags were like "manageable" but not
"supported" (in the sense of constituting a stable interface).
However, I was surprised to find that I wasn't able to modify these flags
via jinfo, which instead elicited the following error:

$ jinfo -flag +TraceClassUnloading 26136

$ jinfo -flag +TraceClassUnloading 26136
Exception in thread "main"
com.sun.tools.attach.AttachOperationFailedException: flag
'TraceClassUnloading' cannot be changed

at sun.tools.jinfo.JInfo.flag(JInfo.java:140)
at sun.tools.jinfo.JInfo.main(JInfo.java:81)

So, what do "product_rw" flags represent, and can they be changed (using
jinfo or similar)?

-- ramki

More information about the hotspot-dev mailing list