Can I change JVM parameters at runtime

I am writing a Java program and at some point during runtime I want to change the JVM settings (reduce the heap) and after a while increase it again. Is this possible with Java?

+4
source share
2 answers

In short: you cannot. The heap size is fixed after it starts, and there is no way to change it from the code.

+1
source

, , , , -Xmx -Xms. : -XX: MaxHeapFreeRatio: (70 , ) , , , GC .

-Xms ( GC), .

, , , GC aka stop-the-world events, .

+1

Source: https://habr.com/ru/post/1531737/


All Articles