Memory problems with script runner


We are getting a strange error on our JIRA instance. JIRA is creating a very large object that crashes JIRA instance after GC timeout... 

We have detect a lot of threads with this stack trace.

Could you please review this error?

Thanks a lot,



  at java.lang.StringCoding$StringDecoder.decode([BII)[C (Unknown Source)
  at com.onresolve.jira.groovy.jql.AbstractScriptedJqlFunction.getIssues(Ljava/lang/String;Lorg/apache/lucene/search/Query;)Ljava/util/List; (AbstractScriptedJqlFunction.groovy:74)
  at sun.reflect.GeneratedMethodAccessor2154.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Unknown Source)
  at java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (Unknown Source)
  at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; (
  at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(Lgroovy/lang/GroovyObject;[Ljava/lang/Object;)Ljava/lang/Object; (
  at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(Lgroovy/lang/GroovyObject;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; (
  at com.onresolve.jira.groovy.jql.AbstractScriptedJqlFunction.getIssues(Ljava/lang/String;)Ljava/util/List; (Unknown Source)
  at com.onresolve.jira.groovy.jql.AbstractScriptedJqlFunction$getIssues.callCurrent(Lgroovy/lang/GroovyObject;Ljava/lang/Object;)Ljava/lang/Object; (Unknown Source)
  at com.onresolve.jira.groovy.jql.EntityMatch.getQuery(Lcom/atlassian/jira/jql/query/QueryCreationContext;Lcom/atlassian/query/operand/FunctionOperand;Lcom/atlassian/query/clause/TerminalClause;)Lorg/apache/lucene/search/Query; (script14333834963861257966674.groovy:88)
  at com.onresolve.jira.groovy.jql.EntityMatch$;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; (Unknown Source)
  at com.onresolve.jira.groovy.jql.ScriptedJqlFunction.getQuery(Lcom/atlassian/jira/jql/query/QueryCreationContext;Lcom/atlassian/query/operand/FunctionOperand;Lcom/atlassian/query/clause/TerminalClause;)Lorg/apache/lucene/search/Query; (ScriptedJqlFunction.groovy:131)
  at com.onresolve.jira.groovy.jql.ScriptedJqlFunction$getQuery$;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; (Unknown Source)
  at com.onresolve.jira.groovy.jql.ScriptedFunctionClauseFactory.getQuery(Lcom/atlassian/jira/jql/query/QueryCreationContext;Lcom/atlassian/query/clause/TerminalClause;)Lcom/atlassian/jira/jql/query/QueryFactoryResult; (ScriptedFunctionClauseFactory.groovy:52)

2 answers

0 votes

Script-runner itself will not cause memory errors (unless you've got too little memory to load it in the first place, but that would apply with any addon).  It's what you do with it that matters.

You'll need to take a close look at the query that your users are triggering to work out what it is doing here.

Hi Nic, Heap is setup with 4 GB. I think that we have located the function on the JQL. I will update this issue. Thanks, --Hugo


More info about this issue

We have reproduce the error on a side environment, using a JQL like this:


project = PROYECT1 AND "CustomFieldA" in (VALUE1,VALUE2, VALUE3) AND issueFunction in issueFieldMatch("", labels, "1.61.0") ORDER BY updated DESC

We have desactivated module "Scripted JQL Function" (scripted-jql-function) and there's no fail at this moment.

That would make sense - the "" in the issueFieldMatch means "read every issue in JIRA" - that's going to be a disaster in terms of performance in any medium to large JIRA installation.

You should be able to get this to work by replacing "" with a better restricting JQL query

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 29, 2018 in Jira

How to set up an incident workflow from the VP of Engineering at Sentry

Hey Atlassian community, I help lead engineering at Sentry, an open-source error-tracking and monitoring tool that integrates with Jira. We started using Jira Software Cloud internally last year, a...

1,089 views 0 8
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you