Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

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:

for (...) {
  def var = new LinkedHashMap()
}

So you should always change it to this form:

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).

  • No labels