I was trying to experiment with jcmd VM.set_flag option. But came across one error saying "only 'writeable' flags can be set". What are writable flags ?
Getting my pid:
XXX@XXX-Air:~/javacode$ jcmd -l
6294 Test
6295 jdk.jcmd/sun.tools.jcmd.JCmd -l
Trying to change vm flags:
XXX@XXX-Air:~/javacode$ jcmd 6294 VM.set_flag ConcGCThreads 4
6294:
only 'writeable' flags can be set
XXX@XXX-Air:~/javacode$ jcmd 6294 VM.set_flag MaxNewSize 1G
6294:
only 'writeable' flags can be set
Edit: It worked for manageable flags, below are successful commands.
XXXX@XXX-Air:~/javacode$ jcmd 11441 VM.flags -all | grep MinHeapFreeRatio
uintx MinHeapFreeRatio = 40 {manageable} {default}
XXXX@XXX-Air:~/javacode$ jcmd 11441 VM.set_flag MinHeapFreeRatio 45
11441:
Command executed successfully
XXXX@XXX-Air:~/javacode$ jcmd 11441 VM.flags -all | grep MinHeapFreeRatio
uintx MinHeapFreeRatio = 45