# Tag Change Scripts are not using current Script Module Edits after a Save Event

**URL:** <https://forum.inductiveautomation.com/t/tag-change-scripts-are-not-using-current-script-module-edits-after-a-save-event/59980>\
**Category:** Ignition\
**Tags:** scripting, ignition81\
**Created:** [May 24, 2022, 7:47pm UTC](https://forum.inductiveautomation.com/t/tag-change-scripts-are-not-using-current-script-module-edits-after-a-save-event/59980 "2022-05-24T19:47:02Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 24, 2022, 8:05pm UTC](https://forum.inductiveautomation.com/t/tag-change-scripts-are-not-using-current-script-module-edits-after-a-save-event/59980/2 "2022-05-24T20:05:52Z")

</div>

> [@dominicfabiilli](#):
>
> Asynchronous threads.

An asynchronous thread carries references to the complete interpreter in which they live. You must kill them off and start new ones when the code they are running (including anything called in other script modules) changes.

Not only is your failure to kill these off preventing them from calling your updated code, but they are leaking huge gobs of gateway heap memory.

(This is true of async threads no matter what kind of event starts them--gateway vs. tag is moot.)

Some guidance:

> [@Managing multiple asynchronous threads](https://forum.inductiveautomation.com/t/managing-multiple-asynchronous-threads/37185/2):
>
> To manage long-running jython threads through scripting restarts, you need to: Place the thread object in a dictionary that retains its content through script restarts. I used to recommend the dictionary from system.util.getGlobals(), but that is no longer suitable. I created a free [Life Cycle Module](http://forum.inductiveautomation.com/t/system-util-getglobals-not-persisted-across-designer-save/33869/14) that provides such dictionaries going forward. Write the asynchronous function’s loop so that it regularly checks [Thread.interrupted()](https://docs.oracle.com/javase/8/docs/api/java/lang/Thread.html#interrupted--), particularly after any java I/O operations. Clean up …

---

_[View the full topic](https://forum.inductiveautomation.com/t/tag-change-scripts-are-not-using-current-script-module-edits-after-a-save-event/59980)._
