Garbage collection: The pause time goal
By default the JVM starts a Stop-The-World garbage collection
cycle when certain memory thresholds are met. The execution time is monitored and if it is longer
than 200 ms limits are adjusted. Today such long pause times are
rarely seen for apps like I2P. The machine we derived the
published load figures from shows an average GC pause time of 72
ms. X86 usually needs some ms only.
You can determine your average pause time from doing some simple
math from the JConsole summary page. I2P does a very good job
coping with long pause times and throws only a few warnings
related to delays caused by GC. You will need to increase your
log level to see that. However there are timers within I2P possibly
striking after 10ms and I2Speed goes down as low as 1 ms. So you
can be pretty sure of delays caused by STW GC and afterwards the
CPU will have to go full throttle for some time to catch up.
If you think your GC pause times are too long (maybe because you
allocated too much memory), you can explicitly set a pause time
goal. In the example above , setting a pause time goal of 20 ms
resulted in STW GC occurring 7 times as frequent using twice as
much CPU. The JVM then sticks very close to the goal you set.
You set the pause time goal using: