question about variables & memory storage

I have a long running method. In it I am just adding text to a global variable.
After the end of the loop in the method I set the global variable to an empty string.
For ex: globals.var1 = “”

Will this release the memory occupied by the variable?

Do I need use globals.var1 = null ?

Any help would be appreciated.

Thanks!

Both should be fine.

Thanks Patrick! I have to do a test for this.

Also I think the local variables (variables defined with “var” in a method) will be released after the method is run.

Am I correct in my thinking?

Thanks!

Yes.