# Ignition 8 - Memory leak

**URL:** <https://forum.inductiveautomation.com/t/ignition-8-memory-leak/45851>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [April 21, 2021, 8:46am UTC](https://forum.inductiveautomation.com/t/ignition-8-memory-leak/45851 "2021-04-21T08:46:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![michal.koblasa](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@michal.koblasa](https://forum.inductiveautomation.com/u/michal.koblasa)\
**Post date:** [April 21, 2021, 8:46am UTC](https://forum.inductiveautomation.com/t/ignition-8-memory-leak/45851/1 "2021-04-21T08:46:41Z")

</div>

Hello,  
we have issue with our ignition, I suspect, that we have Memory leak in our gateway.  
Memory is growing overtime, until gateway gets laggy and i need to do restart.  
How should i proceed to debug, where to look for (what are most common memory leaks)?

Screen after restart:

 ![Screenshot 2021-04-21 104142](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/f/3f6a4f036c2e2d4393c63444055a150288c2f541.png)

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [April 21, 2021, 9:39am UTC](https://forum.inductiveautomation.com/t/ignition-8-memory-leak/45851/2 "2021-04-21T09:39:25Z")

</div>

> [@Ignition server memory increasing](http://forum.inductiveautomation.com/t/ignition-server-memory-increasing/43932/4):
>
> Firing off async threads without a means to kill off. A single jython async thread stuck in an infinite wait or infinite loop will hold the entire old interpreter in memory after a scripting restart. Opening python sockets without try-finally guards to close. Attaching python listeners to java infrastructure with no way to remove/retire. Caching python objects without control over lifetimes. All of the above are prone to happen regularly as projects are edited and scripts are restarted (pe…

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 21, 2021, 4:23pm UTC](https://forum.inductiveautomation.com/t/ignition-8-memory-leak/45851/3 "2021-04-21T16:23:17Z")

</div>

> [@michal.koblasa](#):
>
> How should i proceed to debug, where to look for (what are most common memory leaks)?

You should get in contact with our support division.

---

<div class="post-metadata">

**Author:** ![Marcus\_Stubbles](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@Marcus\_Stubbles](https://forum.inductiveautomation.com/u/Marcus_Stubbles)\
**Post date:** [October 5, 2023, 1:29pm UTC](https://forum.inductiveautomation.com/t/ignition-8-memory-leak/45851/4 "2023-10-05T13:29:54Z")

</div>

One other item to add to the list that might cause something like this: Importing and using Python libraries that didn't come with Ignition.

In our case, we brought in the requests library because we were familiar with it and wanted to use it to contact various REST APIs. It took a long time to figure this out, but that library must have been doing at least one of the things that JordanCClark mentioned above, because our non-heap memory was slowly growing over time. On a hunch, we went back in and re-wrote all that code to use only Ignition's [system.net](http://system.net) library instead. And the memory leak stopped.

So, for the folks fighting a memory leak who find their way to this old post, that's one more thing to try.

---

<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:** [October 5, 2023, 1:41pm UTC](https://forum.inductiveautomation.com/t/ignition-8-memory-leak/45851/5 "2023-10-05T13:41:08Z")

</div>

> [@Marcus\_Stubbles](#):
>
> that's one more thing to try.

Yes, the `requests` library is one of the things that gets people in trouble. (Mainly because jython's `socket` implementation seems to be a disaster.)

My advice scattered all over this forum is to avoid jython/python imports for anything that can be done any other way. Use Ignition's `system.*` functions first, then java's standard classes, then any classes distributed by default with Ignition (there's a whole bunch), then, possibly, module-supplied classes.
