# \[IGN-5244\]Persist Python Class Object

**URL:** <https://forum.inductiveautomation.com/t/ign-5244-persist-python-class-object/30498>\
**Category:** Ignition\
**Created:** [December 6, 2019, 5:37pm UTC](https://forum.inductiveautomation.com/t/ign-5244-persist-python-class-object/30498 "2019-12-06T17:37:15Z")\
**Posts on this page:** 1\
**Showing post:** 38

<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:** [December 1, 2022, 7:42pm UTC](https://forum.inductiveautomation.com/t/ign-5244-persist-python-class-object/30498/38 "2022-12-01T19:42:07Z")

</div>

You might find the techniques in this topic helpful. The same life cycle considerations for background threads apply to any kind of jython class objects you try to persist. Be aware that you **cannot** leave a jython class instance in any global scope through a scripting restart. That leaks a big chunk of memory, and your class object **keeps running the old code**.

> [@Managing multiple asynchronous threads](https://forum.inductiveautomation.com/t/managing-multiple-asynchronous-threads/37185):
>
> I've followed this post for monitoring a directory for file changes and I think I have created more than one watch service in different threads. How do I monitor, manage, and delete these threads?

---

_[View the full topic](https://forum.inductiveautomation.com/t/ign-5244-persist-python-class-object/30498)._
