2

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.

Community
  • 1
  • 1
maaartinus
  • 44,714
  • 32
  • 161
  • 320
  • What version of Caliper are you on? – BeeOnRope Sep 23 '14 at 05:06
  • @BeeOnRope Hard to say, I'm using HEAD from [git](http://code.google.com/p/caliper/source/checkout), currently half a year old. But I'm ready to upgrade or switch to some repository, if it helps. – maaartinus Sep 23 '14 at 05:26
  • Right, newer than me then. I'm still on 0.5rc and was going to check there. I've had luck preventing GC by ensuring I do a System.gc() in the setup and then have NewSize as large as possible. That only goes so far though, if you allocate more than eden, you're going to GC, not way around it. To pass multiple JVM arguments (rather that a list of combinations to try), you just need to have multiple -J arguments, like -JXmx=-Xmx512M -JNewSize=-XX:NewSize=12G, etc. The name you give the is irrelevant. – BeeOnRope Sep 24 '14 at 06:23

0 Answers0