# Global objects in Perspective Scope

**URL:** <https://forum.inductiveautomation.com/t/global-objects-in-perspective-scope/53688>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [December 2, 2021, 5:19pm UTC](https://forum.inductiveautomation.com/t/global-objects-in-perspective-scope/53688 "2021-12-02T17:19:01Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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 2, 2021, 6:35pm UTC](https://forum.inductiveautomation.com/t/global-objects-in-perspective-scope/53688/5 "2021-12-02T18:35:43Z")

</div>

> [@kgamble](#):
>
> Is it generally safe to put custom class instances inside `getGlobals()` , or do they need to be serializable?

No. Unless the project script that defines the class includes code to replace any persistent instances whenever the script restarts. Jython class instances reference the code that defines them, which will be old code after the defining script restarts. That old code lives in an old interpreter, which leaks huge chunks of memory. Be absolutely sure you replace custom class instances in any persistent use. That isn't limited to just .getGlobals() or my `system .util.persistent()` function, but would include anywhere you've added a listener into Ignition's infrastructure.

---

_[View the full topic](https://forum.inductiveautomation.com/t/global-objects-in-perspective-scope/53688)._
