Skip to main content
July 11, 2014
Answered

Does ExtendScript Have Garbage Collection?

  • July 11, 2014
  • 1 reply
  • 852 views

I am learning to script PhotoShop using JavaScript (ExtendScript). On page page 20 of the PhotoShop Scripting Guide CC 2014, a simple "hello world" script is presented. At the end of this script the following code is included:

// Release references

docRef = null

artLayerRef = null

textItemRef = null

Why is this necessary? Wouldn't the completion of this script cause garbage collection to forget about these references? Or are these references maintained for some reason while running PhotoShop and so releasing them is good for memory management?

This topic has been closed for replies.
Correct answer Muppet Mark

Yes ExtendScript has Garbage Collection… I've never had the need to use…

blah = boo = foo = null; // I see very few users bothering to do this…

There is also the $.gc() method available too…

1 reply

Muppet MarkCorrect answer
Inspiring
July 11, 2014

Yes ExtendScript has Garbage Collection… I've never had the need to use…

blah = boo = foo = null; // I see very few users bothering to do this…

There is also the $.gc() method available too…

July 11, 2014

Thanks!