cancel
Showing results for 
Search instead for 
Did you mean: 

Groovy script tasks and excessive major garbage collections

tomasz_lewandow
Champ in-the-making
Champ in-the-making
After load-testing my app (~100k executed processes)  I observed a memory problem using Groovy script tasks in Activiti processes. It boils down to excessive major garbage collections which slows down entire system.
Next I isolated the problem (simple process with simple bootstrap app that starts the processes in a loop - zzzActiviti.tar.gz) and used jstat to measure gc:


$ java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
$ uname -a
Linux PC03 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

$ mvn compile
$ export MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m"
$ mvn exec:java -Dexec.mainClass="ZzzActivitiMain" &> output.log &
[1] 2456
$ jstat -gc 2456 5000

EC       EU        OC         OU        PC       PU         YGC    YGCT  FGC      FGCT     GCT  
118976,0 80852,1 79872,0    3089,3    42560,0  42410,0      6    0,070   0      0,000    0,070
115968,0 56815,0 79872,0    43960,8   48704,0  48655,2      9    0,184   0      0,000    0,184
58240,0  0,0     147008,0   139810,6  100096,0 55665,5     15    0,364   2      0,343    0,707
58240,0  0,0     256576,0   223691,1  116672,0 64095,8     23    0,613   3      0,757    1,370
58240,0  20977,0 349568,0   307842,9  120448,0 72860,2     31    0,835   3      1,350    2,185
58240,0  58240,0 349568,0   347955,4  121920,0 76346,5     32    0,856   7      4,129    4,985
58240,0  58240,0 349568,0   349567,9  109824,0 78896,1     32    0,856  11      7,809    8,665
58240,0  58240,0 349568,0   349567,9  97984,0  80035,6     32    0,856  15     11,685   12,541
58240,0  58240,0 349568,0   349568,0  89344,0  80618,2     32    0,856  20     16,501   17,357
58240,0  58240,0 349568,0   349568,0  84928,0  80885,8     32    0,856  25     21,312   22,168
58240,0  4044,4  217856,0   34305,1   43904,0  43506,8     33    0,875  30     26,376   27,250
57216,0  38979,7 217856,0   117382,4  54464,0  54269,1     43    1,124  30     26,376   27,499
55104,0  6640,1  349568,0   226050,5  75392,0  63492,8     53    1,405  31     27,062   28,468
56640,0  0,0     349568,0   327553,8  75392,0  74491,6     64    1,656  32     27,062   28,718
56640,0  37095,4 349568,0   349566,9  91200,0  77300,6     64    1,656  35     30,697   32,353
56640,0  56640,0 349568,0   349561,3  88064,0  79363,5     64    1,656  40     34,228   35,884
56640,0  56640,0 349568,0   349561,0  84992,0  80285,6     64    1,656  45     38,654   40,310
56640,0  56640,0 349568,0   349561,0  82496,0  80630,2     64    1,656  51     43,922   45,578
56640,0  56640,0 349568,0   349560,9  81856,0  80719,8     64    1,656  56     48,379   50,035
54208,0  39264,9 214784,0   78622,4   50496,0  50295,4     71    1,852  58     50,733   52,585
55168,0  0,0     214784,0   197725,4  60480,0  60387,0     82    2,098  59     50,733   52,832
55296,0  30960,2 349568,0   304583,7  72832,0  71474,8     93    2,421  59     51,417   53,838
56192,0  56192,0 349568,0   343348,6  89472,0  75487,2     95    2,461  63     54,095   56,556
56192,0  56192,0 349568,0   349567,0  87360,0  78194,5     95    2,461  67     57,735   60,196
56192,0  56192,0 349568,0   349566,9  84672,0  79554,4     95    2,461  72     62,402   64,862
56192,0  56192,0 349568,0   349566,2  82496,0  80118,4     95    2,461  77     67,349   69,809
56192,0  56192,0 349568,0   349566,2  81728,0  80298,3     95    2,461  82     71,812   74,273
[code]

As you can see, after ~1min the old generation is full and major GC runs about every second.
Any solutions (beside using javascript or not using script tasks:) )?
3 REPLIES 3

tomasz_lewandow
Champ in-the-making
Champ in-the-making
.

frederikherema1
Star Contributor
Star Contributor
We just pass the script-execution on to the JSR-223 (Scripting), so this is nothing acidity can change, I'm affriad. If you're going to have a lot of processes like you do, consider using compiled JavaDelegate as opposed to using scripts…

jbarrez
Star Contributor
Star Contributor
That doesn't sound good … but we're actually using the default JDK mechanism to fire off scripts so I don't know if improvement could be made here …

Did you try on JDK 7? Scripting has improved on it.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.