Programmatically determine if the JVM uses class separation or not?

Some JVMs have the Drive Sharing option enabled. Is there a way to determine if this option is enabled programmatically?

thanks

+6
source share
1 answer

there is no sensible way to get this that I know of ...

you can get the command line used to invoke your JVM and look at the flags described here . if all you want to do is ensure that the function is disabled, it's simple - you need the disable flag to be present.

note that this document is rated at 1.5, and it says that sharing is also dependent on the garbage collector used, so you also need to output it (also possible given the jvm version, command line, OS version and more patience: -)).

you also need to contact this per-jvm provider. For example, ibm jvm uses different flags

+3
source

All Articles