# Ignition Memory Questions

**URL:** <https://forum.inductiveautomation.com/t/ignition-memory-questions/42984>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [February 3, 2021, 8:29pm UTC](https://forum.inductiveautomation.com/t/ignition-memory-questions/42984 "2021-02-03T20:29:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![scott.stamps](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@scott.stamps](https://forum.inductiveautomation.com/u/scott.stamps)\
**Post date:** [February 3, 2021, 8:29pm UTC](https://forum.inductiveautomation.com/t/ignition-memory-questions/42984/1 "2021-02-03T20:29:29Z")

</div>

We have a couple of questions around memory on our Ignition Gateway. This server is running Windows Server 2016, 16gb ram and Ignition 8.1 only (our historian database is not installed on this server). Appreciate any thoughts.

1. We have noticed cyclical memory spikes but are unsure as to the cause. How might we better go about pinpointing the issue? See the Memory, Scripts & Threads images below.

- Memory  
. ![Screenshot 2021-02-03 140546](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/1/e138befb97a2d0b16f99a06303fe7f11b216b434.png)

- Scripts (Status \> Diagnostics \> Running Scripts)  

- Threads (Status \> Diagnostics \> Threads) 

1. As mentioned, this server has 16gb of ram, of which we have allocated to Ignition (ignition.conf) as below. Is there a best practice in order to determine the best init/max values based on total amount of system ram?  
 ![Screenshot 2021-02-03 142058](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/c/1c684a0c88a068e2c3a7e4a7f58944c85658bc1e.png)

---

<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:** [February 3, 2021, 9:30pm UTC](https://forum.inductiveautomation.com/t/ignition-memory-questions/42984/2 "2021-02-03T21:30:57Z")

</div>

> [@scott.stamps](#):
>
> We have noticed cyclical memory spikes but are unsure as to the cause. How might we better go about pinpointing the issue? See the Memory, Scripts & Threads images below.

Cylical 'sawtooth' memory usage like that is perfectly normal. The GC will allow things to "pile up", then collect in one pass, freeing a lot of memory at once. Abnormal memory graphs will be immediately obvious as both a lot more chaotic, and also frequently 'pegging' against the maximum memory. Underallocated or underprovisioned systems will also likely get lots of 'Clock Drift' errors, as the garbage collector forces the entire JVM to pause.

In other words - I don't think you have any actual problem, unless you're experiencing some other side effect.

---

<div class="post-metadata">

**Author:** ![scott.stamps](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@scott.stamps](https://forum.inductiveautomation.com/u/scott.stamps)\
**Post date:** [February 3, 2021, 10:13pm UTC](https://forum.inductiveautomation.com/t/ignition-memory-questions/42984/3 "2021-02-03T22:13:51Z")

</div>

Great! We actually have ran into ‘Clock Drift’ several times. Would allocating more memory to Ignition address this?

---

<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:** [February 3, 2021, 11:23pm UTC](https://forum.inductiveautomation.com/t/ignition-memory-questions/42984/4 "2021-02-03T23:23:24Z")

</div>

Not necessarily. You _can_ provide tuning options to the JVM to tell the garbage collector to run more aggressively (generally meaning you’ll trade CPU pressure for RAM pressure) - simply adding more memory is not a panacea. If you _do_ want to go that route, I’d start with googling the G1 garbage collector and the tuning options it exposes, and making sure you understand them thoroughly before making any changes to your system.

---

<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:** [February 4, 2021, 1:46pm UTC](https://forum.inductiveautomation.com/t/ignition-memory-questions/42984/5 "2021-02-04T13:46:37Z")

</div>

I recommend setting G1GC’s target pause to 100ms. Or a bit less if you have beefy hardware. Your sawtooth graph is otherwise about as perfect as you might get. I recommend setting max memory such that the trough of the graph is in the 30% to 50% range, and the peaks are in the 50% to 80% range. I also recommend setting min==max. Any long-running process is going to allocate the max allowed, so there’s no point not doing it at startup.

---

<div class="post-metadata">

**Author:** ![scott.stamps](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@scott.stamps](https://forum.inductiveautomation.com/u/scott.stamps)\
**Post date:** [February 4, 2021, 3:00pm UTC](https://forum.inductiveautomation.com/t/ignition-memory-questions/42984/6 "2021-02-04T15:00:06Z")

</div>

Thanks Phil. Just so I’m clear, I have included portions of our current ignition.conf, as well as with potential changes. Assuming the calculations say ~8gb of memory is ‘right’ for us, is the rest accurate?

**Current** :

 ![Screenshot 2021-02-04 085007](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/e/0e015a71728d65020cd76705cc4adbfa8f616540.png)

**Potential** :

![Screenshot 2021-02-04 084333](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/d/ad1ca29639d5ac759b005dbe6f2d373198f75ca9.png)

---

<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:** [February 4, 2021, 3:15pm UTC](https://forum.inductiveautomation.com/t/ignition-memory-questions/42984/7 "2021-02-04T15:15:21Z")

</div>

Looks like what I would do. (:

---

<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:** [February 4, 2021, 3:16pm UTC](https://forum.inductiveautomation.com/t/ignition-memory-questions/42984/8 "2021-02-04T15:16:35Z")

</div>

Consider using the gclog options to monitor your GC pause durations. (Makes a separate log file just for GC traffic.)

---

<div class="post-metadata">

**Author:** ![scott.stamps](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@scott.stamps](https://forum.inductiveautomation.com/u/scott.stamps)\
**Post date:** [February 4, 2021, 3:23pm UTC](https://forum.inductiveautomation.com/t/ignition-memory-questions/42984/9 "2021-02-04T15:23:14Z")

</div>

Ok. Is that as simple as, say, this?  
 ![Screenshot 2021-02-04 092146](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/0/a0c71a48a3c97f44c3ee6a16d6a4036eb048743c.png)

---

<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:** [February 4, 2021, 3:26pm UTC](https://forum.inductiveautomation.com/t/ignition-memory-questions/42984/10 "2021-02-04T15:26:58Z")

</div>

I’ve never used a wildcard like that. Mine looks like this:

```auto
wrapper.java.additional.3=-Xloggc:/var/log/ignition/javagc-%WRAPPER_TIME_YYYYMMDDHHIISS%.log
wrapper.java.additional.6=-XX:+PrintGCDetails

```

The WRAPPER\_TIME makes it start a new file every startup. IIRC, this logger doesn’t append.

---

<div class="post-metadata">

**Author:** ![scott.stamps](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@scott.stamps](https://forum.inductiveautomation.com/u/scott.stamps)\
**Post date:** [February 4, 2021, 4:06pm UTC](https://forum.inductiveautomation.com/t/ignition-memory-questions/42984/11 "2021-02-04T16:06:21Z")

</div>

Got it. So, holistically, our params could look something like:

 ![Screenshot 2021-02-04 100354](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/d/bd27268f5765a13ae84f363f789fb2b9f8462653.png)

---

<div class="post-metadata">

**Author:** ![scott.stamps](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@scott.stamps](https://forum.inductiveautomation.com/u/scott.stamps)\
**Post date:** [February 4, 2021, 4:14pm UTC](https://forum.inductiveautomation.com/t/ignition-memory-questions/42984/12 "2021-02-04T16:14:38Z")

</div>

Or, as we are on Windows, this might be more accurate:

 ![Screenshot 2021-02-04 101341](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f7527a379271204830a4e47fdb61d082063059dc.png)

---

<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:** [February 4, 2021, 4:23pm UTC](https://forum.inductiveautomation.com/t/ignition-memory-questions/42984/13 "2021-02-04T16:23:33Z")

</div>

> [@scott.stamps](#):
>
> we are on Windows

My condolences. /:

---

<div class="post-metadata">

**Author:** ![scott.stamps](https://avatars.discourse-cdn.com/v4/letter/s/ba9def/32.png) [@scott.stamps](https://forum.inductiveautomation.com/u/scott.stamps)\
**Post date:** [February 4, 2021, 4:25pm UTC](https://forum.inductiveautomation.com/t/ignition-memory-questions/42984/14 "2021-02-04T16:25:37Z")

</div>

Ain’t that the truth.

Thanks guys. Good stuff - super helpful!
