# Ignition server memory increasing

**URL:** <https://forum.inductiveautomation.com/t/ignition-server-memory-increasing/43932>\
**Category:** Ignition\
**Created:** [March 1, 2021, 11:02am UTC](https://forum.inductiveautomation.com/t/ignition-server-memory-increasing/43932 "2021-03-01T11:02:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![maja](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@maja](https://forum.inductiveautomation.com/u/maja)\
**Post date:** [March 1, 2021, 11:02am UTC](https://forum.inductiveautomation.com/t/ignition-server-memory-increasing/43932/1 "2021-03-01T11:02:53Z")

</div>

Hi to All,

Gatewey that is in production stopped working. On the client PC they could see an Error message “Error loading resources: Requesting component defaults time out”. The users had to restart the gateway PC.  
After restarting and investigating the log files I found out that the message “Clock drift, degraded performance, or pause-the-world detected. Max allowed deviation=1000ms, actual deviation=4554ms” (with different actual deviation) was repeating for almost 20 hours.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/7/47770f1deb961097099603f8a90ebc0a084f786b.jpeg)

Config file:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/d/edd3ba1f7d767518302f45135d184defa619f933.jpeg)

Gateway Host is running in VM(Nutanix) below you can see the chart about memory usage for the last month. This chart is a little bit unclear, doesn’t show the amount of memory.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/5/950d8ac2fe3a5b93d0d537cb6da2b8e27d3c0df6.jpeg)

I have no insight into setting the memory by the host for Gatewey VM. I was told it was assigned I think 16GB. When gatewey was restarted the first time Host of the gatewey VM was showing the VM using more than 50% of the assigned memory.  
System info from Gatewey Pc showing next

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/b/eb796e38c3b25964586c9310a13ebec0280825ce.jpeg).

After restarting Pc and let getaway run again. I notice (from gatewey page) that used memory growing per day around 200mb.

Is this memory liking, or garbage collector, or something that I wrote wrong?

Thanks!

---

<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:** [March 1, 2021, 1:21pm UTC](https://forum.inductiveautomation.com/t/ignition-server-memory-increasing/43932/2 "2021-03-01T13:21:46Z")

</div>

That is a memory leak, almost certainly. Could be something in your scripting. You definitely should get support involved if you aren’t comfortable profiling your gateway.

---

<div class="post-metadata">

**Author:** ![maja](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@maja](https://forum.inductiveautomation.com/u/maja)\
**Post date:** [March 1, 2021, 9:57pm UTC](https://forum.inductiveautomation.com/t/ignition-server-memory-increasing/43932/3 "2021-03-01T21:57:12Z")

</div>

Phil,

Thank you very much for your answer. I opened a ticket, but it usually takes time to get some response. I do not have a problem to profiling the gatewey. I have a problem analyzing results. I do not have experience with java, memory leak, garbage collector…  
How can scripting lead to memory leaks?

Thanks!

---

<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:** [March 2, 2021, 12:18am UTC](https://forum.inductiveautomation.com/t/ignition-server-memory-increasing/43932/4 "2021-03-02T00:18:18Z")

</div>

> [@maja](#):
>
> How can scripting lead to memory leaks?

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 (per project in the gateway).

---

<div class="post-metadata">

**Author:** ![maja](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@maja](https://forum.inductiveautomation.com/u/maja)\
**Post date:** [March 2, 2021, 11:02pm UTC](https://forum.inductiveautomation.com/t/ignition-server-memory-increasing/43932/5 "2021-03-02T23:02:43Z")

</div>

Phil,

Thank you very much for your answer and all your effort.  
I do not use any of mentioned in my scripts that I know. I have pages with a lot of objects and movements of some objects. I am working a lot with the dataset. Also, I am using your view expression, which is great.  
A lot of XY charts in the carousel object that is in autoplay mode. Lots of scripts lot of happening, but all are based on basic python scripting.

---

<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:** [March 3, 2021, 10:44am UTC](https://forum.inductiveautomation.com/t/ignition-server-memory-increasing/43932/6 "2021-03-03T10:44:41Z")

</div>

I’d probably start profiling memory usage, then. I’d start with the `jmap` tool’s histogram mode for per-class memory usage. Unfortunately, taking a profile snapshot isn’t instant–your gateway will freeze for a couple seconds. Do this multiple times, a day apart each, and look if there is a a particular class or collection of classes responsible for ~ 200meg extra per day. If so, take a full snapshot and look where those classes are being allocated. (Or turn it over to IA support at that point.)
