Terracotta Java heap space

Christopher Bongaarts cab at umn.edu
Mon Nov 26 12:28:04 EST 2012

On 11/20/2012 12:57 AM, Wessel, Keith William wrote:

> 2.I could run the run-dgc-if-active script more often. This seems
> unwise, though, as I don’t want lengthy pauses in my IDP activity during
> the day if, say, I run this every six or twelve hours.

When we were running Terracotta and got things close to stable, I wanted 
to try this but was never brave enough to do it in production.

If you run it often enough, the pauses are kept to a minimum.  The TC 
console is helpful for checking on timing, as well as the TC server logs.

> 3.The computer scientist in me says to just increase the heap space to 2
> GB or even 1.5. Since this is hard coded in Terracotta’s
> start-tc-server.sh, I’d have to remember to adjust this on upgrades, and
> the fact that there’s no external way to change it makes me think it
> shouldn’t need to be changed. It would most likely fix the problem or at
> least put off the problem until the DB gets really big, but would it
> introduce other issues caused by a very large heap space needing to be
> searched?

The TC server needs enough heap space to store all its stuff at peak 
usage (which in this case is right before you run DGC).  You should 
definitely consider raising the heap space.  Just be careful to balance 
it so when Java needs to do *its* GC it doesn't stop the world too long.

Here's what we had as java opts for TC server at the end:

-Xmx1536m -Xms1536m -XX:+UseParallelOldGC -verbose:gc 
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:-TraceClassUnloading

We also tried using

-Xmx1536m -XX:+UseParallelOldGC -XX:MaxGCPauseMillis=5000 -verbose:gc 
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:-TraceClassUnloading

to try to encourage Java's auto-tuning to keep the GC under 5 seconds, 
but it didn't seem to work as well as I had hoped.

Someone with more in-depth Java tuning skills might be able to give 
better advice given the workload/object life-cycles for Terracotta.

%%  Christopher A. Bongaarts   %%  cab at umn.edu          %%
%%  OIT - Identity Management  %%  http://umn.edu/~cab  %%
%%  University of Minnesota    %%  +1 (612) 625-1809    %%

More information about the users mailing list