# Ui-control possible memory leak

**URL:** <https://discourse.nodered.org/t/ui-control-possible-memory-leak/90768>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [7 September 2024 11:53 UTC](https://discourse.nodered.org/t/ui-control-possible-memory-leak/90768 "2024-09-07T11:53:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaetano](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaetano/32/81395_2.png) [@Gaetano](https://discourse.nodered.org/u/Gaetano)\
**Post date:** [7 September 2024 11:53 UTC](https://discourse.nodered.org/t/ui-control-possible-memory-leak/90768/1 "2024-09-07T11:53:13Z")

</div>

I use Dashboard 2 under NodeRed 4.0.2.  
I use ui-control to go to a specific page.

My syslog has many lines produced every time ui-control is used.

The syslog lines are as follows:

```auto
2024-09-07T13:47:36.641313+02:00 PI4bOpenVPN Node-RED[1245]: 7 Sep 13:47:36 - [info] [ui-base:My Dashboard] Disconnected qa_VLuMd2wRUj_SPAABK due to transport close
2024-09-07T13:47:36.900614+02:00 PI4bOpenVPN Node-RED[1245]: (node:1245) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 disconnect listeners added to [Socket]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit
2024-09-07T13:47:36.900909+02:00 PI4bOpenVPN Node-RED[1245]: (node:1245) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ui-control listeners added to [Socket]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit

```

I think the limit of 10 MaxListeners is too low, but I think it should be evaluated better by FlowFuse.

Thanks, bye

---

<div class="post-metadata">

**Author:** ![Gaetano](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaetano/32/81395_2.png) [@Gaetano](https://discourse.nodered.org/u/Gaetano)\
**Post date:** [9 September 2024 14:14 UTC](https://discourse.nodered.org/t/ui-control-possible-memory-leak/90768/2 "2024-09-09T14:14:55Z")

</div>

Sorry to insist but the problem could be important.  
Can I have some feedback on my post?  
Thanks a lot, bye!

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [9 September 2024 15:24 UTC](https://discourse.nodered.org/t/ui-control-possible-memory-leak/90768/3 "2024-09-09T15:24:01Z")

</div>

Hi @Gaetano, it is likely down to how many nodes are in use (i.e. it is not spiralling away).

Please raise this as a [new issue](https://github.com/FlowFuse/node-red-dashboard/issues/new/choose) on the dashboard repository so that it can be tracked and not forgotten or lost in a forum thread.

Please include info like the dashboard version, how many ui-control nodes you have, how and when the log event happens (i.e. on node-red start up, when you deploy changes to Node-RED, every time you page change in the dashboard, every time you refresh the dashboard, every time a new browser connects to the dashboard etc) - that will help us pin it down.

Thanks.

---

<div class="post-metadata">

**Author:** ![Gaetano](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gaetano/32/81395_2.png) [@Gaetano](https://discourse.nodered.org/u/Gaetano)\
**Post date:** [10 September 2024 06:11 UTC](https://discourse.nodered.org/t/ui-control-possible-memory-leak/90768/4 "2024-09-10T06:11:16Z")

</div>

Steve,  
thank you for your reply.

I use NodeRed 4.0.2 on Raspberry PI 4b (4 GB RAM, free 400 KB) with Raspbian 6.6.47. Number of nodes is about 80.  
Dashboard 2 version 1.16.0.  
NodeJS version 20.17.0

ui-control is used only in 4 places:  
3 of them directly in flows  
1 in a subflow (named "Trigger-DB2") that is used to refresh a page on the browser and to trigger a flow. See the content of subflow:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/1/a12f600080ea6c633ce2fdb0da2d75e34d7eb355.png)

The number of instances of this subflow is 15.

The content of ui-ctrl-db2 is:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/8/589dfb655cce6f4aa43974c3862fc831f167e40a.png)

I obtain the message on syslog each time I use ui-control. For example, if I do a refresh on this page (but the message is presented on all pages):

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/2/f22d10f9cd6fd421ff2f834ea81464a0c6c259bc.png)

On syslog I see:

```auto
2024-09-10T08:01:34.754384+02:00 PI4bOpenVPN Node-RED[502]: 10 Sep 08:01:34 - [info] [ui-base:My Dashboard] Disconnected IpwNNDsYi01xHTbzAACd due to transport close
2024-09-10T08:01:34.955434+02:00 PI4bOpenVPN Node-RED[502]: (node:502) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 disconnect listeners added to [Socket]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit
2024-09-10T08:01:34.955830+02:00 PI4bOpenVPN Node-RED[502]: (node:502) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ui-control listeners added to [Socket]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit

```

The NodeRed flow that is under "Soglia Attuale" of the page is:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/b/3b476140f54a72a47021253f7643da14bd9b0d03.png)

If you need other information, don't hesitate to ask me.

Ciao!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 October 2024 06:12 UTC](https://discourse.nodered.org/t/ui-control-possible-memory-leak/90768/5 "2024-10-10T06:12:13Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
