# Slow system.nav.swapTo (increasingly slower over time)

**URL:** <https://forum.inductiveautomation.com/t/slow-system-nav-swapto-increasingly-slower-over-time/64110>\
**Category:** Ignition\
**Tags:** ignition80, vision\
**Created:** [September 15, 2022, 11:59am UTC](https://forum.inductiveautomation.com/t/slow-system-nav-swapto-increasingly-slower-over-time/64110 "2022-09-15T11:59:37Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![johannes.bo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/johannes.bo/32/27628_2.png) [@johannes.bo](https://forum.inductiveautomation.com/u/johannes.bo)\
**Post date:** [September 15, 2022, 11:59am UTC](https://forum.inductiveautomation.com/t/slow-system-nav-swapto-increasingly-slower-over-time/64110/1 "2022-09-15T11:59:37Z")

</div>

Hi,  
I have a performance issue. Maybe someone has some idea how to troubleshoot or fix this.  
My customer experience slow .swapto operations.

The performance is ok on a freshly started Vision client. After some days the time it takes to navigate between main windows increases to 5-\>10 seconds.  
By restarting the client, everything seems snappy again.

ref the attached photo, the client having the issue is running 4 desktops.  
-There are also 2 other clients running without the same issues. But with slightly different usage patterns. Only 1 desktop pr client and possibly less swapping between pages.

-Main windows having caching set to auto. I have been navigating between all pages on a freshly restarted client without performance issues.  
-Clients have 512mb allocated memory on the gateway

What could possibly explain such behaviour  
Running Ignition 8.1.9

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

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 15, 2022, 12:09pm UTC](https://forum.inductiveautomation.com/t/slow-system-nav-swapto-increasingly-slower-over-time/64110/2 "2022-09-15T12:09:17Z")

</div>

2 things spring to mind:

1. Are you opening or swapping main windows (you should be swapping)? (if you display the result of `system.gui.getWindowNames()` somewhere called from a button, how many windows are open when it’s slow?)
2. are you calling `system.alarm.queryStatus()` from your GUI anywhere? (queryStatus is the devil, especially for Vision when calling from the GUI and _will_ kill your clients, and won’t be great for your gateway either)

Nice looking screens though, from what we can see 🙂 clean is good!

---

<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:** [September 15, 2022, 12:43pm UTC](https://forum.inductiveautomation.com/t/slow-system-nav-swapto-increasingly-slower-over-time/64110/3 "2022-09-15T12:43:21Z")

</div>

Give your clients a larger memory allowance. (It doesn’t consume memory on the gateway. Vision runs on the client machine.) 512MB is pretty tight for complex graphics.

---

<div class="post-metadata">

**Author:** ![johannes.bo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/johannes.bo/32/27628_2.png) [@johannes.bo](https://forum.inductiveautomation.com/u/johannes.bo)\
**Post date:** [September 15, 2022, 12:51pm UTC](https://forum.inductiveautomation.com/t/slow-system-nav-swapto-increasingly-slower-over-time/64110/4 "2022-09-15T12:51:55Z")

</div>

1. I am swapping. only one window returned with system.gui.getWindowName()
2. I am running system.alarm.queryStatus() from within a tag change-script. This will execute on the gateway only? yes?  
Thanks for the feedback, yes clean is good 🙂

---

<div class="post-metadata">

**Author:** ![johannes.bo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/johannes.bo/32/27628_2.png) [@johannes.bo](https://forum.inductiveautomation.com/u/johannes.bo)\
**Post date:** [September 15, 2022, 12:53pm UTC](https://forum.inductiveautomation.com/t/slow-system-nav-swapto-increasingly-slower-over-time/64110/5 "2022-09-15T12:53:25Z")

</div>

Ok, will do.  
I actually have misunderstood where memory is allocated regarding Vision clients 😉

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 15, 2022, 12:54pm UTC](https://forum.inductiveautomation.com/t/slow-system-nav-swapto-increasingly-slower-over-time/64110/6 "2022-09-15T12:54:41Z")

</div>

> [@johannes.bo](#):
>
> I am running system.alarm.queryStatus() from within a tag change-script. This will execute on the gateway only? yes?

I'd move this out of a tag change script and into a gateway timer script if you can. No impact to clients, but it'll avoid missed tag change script events if the query takes too long

---

<div class="post-metadata">

**Author:** ![johannes.bo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/johannes.bo/32/27628_2.png) [@johannes.bo](https://forum.inductiveautomation.com/u/johannes.bo)\
**Post date:** [September 15, 2022, 12:55pm UTC](https://forum.inductiveautomation.com/t/slow-system-nav-swapto-increasingly-slower-over-time/64110/7 "2022-09-15T12:55:19Z")

</div>

Ok, will do as well

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 15, 2022, 12:57pm UTC](https://forum.inductiveautomation.com/t/slow-system-nav-swapto-increasingly-slower-over-time/64110/8 "2022-09-15T12:57:48Z")

</div>

As long as it’s a gateway tag. If its a client tag with a client tag change script, it is executing on the client.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 15, 2022, 12:59pm UTC](https://forum.inductiveautomation.com/t/slow-system-nav-swapto-increasingly-slower-over-time/64110/9 "2022-09-15T12:59:27Z")

</div>

True. I actually recently found 27 vision client tags in one of my OOOOOLDDD projects when I first started Ignition all using runScript expressions calling queryStatus… I thought I was so smart, but I was definitely at the peak of Mt Stupid. I also always wondered why the clients were a bit sluggish and the gateway was being hammered by hundreds of alarm queries per second across the GAN 🙄 smh

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/0/401948fc62e9cd0f810e9630f93facc261e51843.png)

---

<div class="post-metadata">

**Author:** ![johannes.bo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/johannes.bo/32/27628_2.png) [@johannes.bo](https://forum.inductiveautomation.com/u/johannes.bo)\
**Post date:** [September 15, 2022, 12:59pm UTC](https://forum.inductiveautomation.com/t/slow-system-nav-swapto-increasingly-slower-over-time/64110/10 "2022-09-15T12:59:33Z")

</div>

Thanks for the clarification. Its a gateway tag

---

<div class="post-metadata">

**Author:** ![Steve\_Laubach](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steve_laubach/32/60900_2.png) [@Steve\_Laubach](https://forum.inductiveautomation.com/u/Steve_Laubach)\
**Post date:** [September 15, 2022, 3:20pm UTC](https://forum.inductiveautomation.com/t/slow-system-nav-swapto-increasingly-slower-over-time/64110/11 "2022-09-15T15:20:31Z")

</div>

We all have those.

I found a problem in something I wrote a long time ago that was deadlocking the database because I didn’t know about SGAM contention and it was using a table variable in a query that was called by multiple clients.

---

<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:** [September 15, 2022, 4:28pm UTC](https://forum.inductiveautomation.com/t/slow-system-nav-swapto-increasingly-slower-over-time/64110/12 "2022-09-15T16:28:35Z")

</div>

There’s also just some general memory leaks in Vision that are fixed in later versions. I’d recommend updating in addition to the other advice in this thread.
