Is there a way to modify the jvm args from inside of the jvm? Specifically, I want to be able to change the maximum heap size of the jvm from inside of it. Is this possible?
Edit: I guess I should add the reason I wanted to do this. I have a few Java programs that are run on different machines/platforms. These programs have configurations that are sourced at runtime and are different depending on the machine/environment the program's running one. Some of these configurations can be changed at runtime and the various programs automatically update themselves as the configurations change.
I wanted heap size to be one of these configuration parameters that is sourced at runtime like the rest of the configuration. If so, then the program could startup (with some default jvm args) then adjust itself based on the retrieved config.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…