You cannot change the JVM mode at runtime, however you can modify some flags without restarting the JVM. Just connect to the JVM using a JMX client (like VisualVM) and use the operation setVMOption
of com.sun.management:type=HotSpotDiagnostic
.
For instance, if you want to enable detailed GC logging without restarting the JVM, call the method setVMOptions("PrintGCDetails", "true")
.
Hope that helps !