When using caliper, I get the
ERROR: GC occurred during timing.
as some garbage gets produced in my benchmark, which I can't avoid. I guess, giving more memory to the target JVM could help, as there's not that much garbage. I'm aware about the -D
and -J
options, but somehow it doesn't work for me.
Firstly, I see in this question that multiple arguments passed via Jmemory=-Xmx512M,-Xmx16M
get used separately, i.e., each comma separated argument leads to a new run. But I'd like to pass multiple arguments to be used together like maybe -Xmx16G -XX:NewSize=12G
, so that the GC gets postponed as much as possible (and actually doesn't come at all as the run finishes in the meantime). How can I do it?
Secondly, what are the best arguments posponing the GC as much as possible? I mean, give the JVM a lot of memory (-Xmx
), use it all for Eden, and don't care about how full it gets.