Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Note that in Groovy variables should not be declared inside the loops.

The following code can result in an error message "Too many new instances created" in the server log:

Code Block
languagegroovy
for (...) {
  def var = [:]
}

So you should always change it to this form:

Code Block
languagegroovy
def var
for (...) {
  var = [:]
}

The technical background is that the first script allocates a new variable which can increase the number of FormulaSandbox instances (above the limit).