# Whether Node-red supports clipping to reduce Node-red running memory？

**URL:** <https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169>\
**Category:** General\
**Created:** [20 February 2019 02:44 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169 "2019-02-20T02:44:17Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)\
**Post date:** [20 February 2019 02:44 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/1 "2019-02-20T02:44:18Z")

</div>

Hi guys,

Currently, the running memory of node-red is too large(About 70M RAM). Due to the memory limit of the embedded device, can the node-red function be clipped to reduce the running memory of node-red？

thanks very much!

---

<div class="post-metadata">

**Author:** ![realjax](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realjax/32/895_2.png) [@realjax](https://discourse.nodered.org/u/realjax)\
**Post date:** [20 February 2019 09:16 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/2 "2019-02-20T09:16:29Z")

</div>

Well.. it is not 'too large' for me. And what is 'the embedded device' ?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [20 February 2019 09:51 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/3 "2019-02-20T09:51:15Z")

</div>

Do you mean the memory usage while running ? You can trim the amount used by node.js before garbage collection kicks in. We usually have a node-red-pi command insalled byt default that allows you to start Node-RED and pass this in easily for example

```
node-red-pi --max-old-space-size=256

```

sets it to 256MB

---

<div class="post-metadata">

**Author:** ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)\
**Post date:** [20 February 2019 10:09 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/4 "2019-02-20T10:09:06Z")

</div>

The Device is Router gateway, the device use 128M RAM.  
Before node-red running, the memory free is 81M  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/a/a647756a74464adfc79cebaa9600f964af5f579d.png)  
After node-red running, the memory free is 5M  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/df823daf3c42b2c00c750bc0ed28653f28ef4b42.png)

The node-red running use almost 76M RAM. i want to know there are anyway to reduce the node-red runnning memory,such as find some way to "clipping the node-red"?

---

<div class="post-metadata">

**Author:** ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)\
**Post date:** [20 February 2019 10:14 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/5 "2019-02-20T10:14:40Z")

</div>

The node-red application use almost 76M RAM in the Router gateway, i need reduce the running memory for node-red.Because my device free memory is only 81M RAM or less. i want to know that whether we can clip the node-red function or other way to reduce the running memory.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [20 February 2019 10:57 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/6 "2019-02-20T10:57:58Z")

</div>

so as I said maybe

```
node-red-pi --max-old-space-size=64

```

or 48 or ...  
but these are not hard limits - this is when garbage collection kicks in - so if you have large buffers arriving (like images etc) then you can easily blow past that... but I don't know what your app is doing so can't guess how much data you are trying to handle.

---

<div class="post-metadata">

**Author:** ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)\
**Post date:** [21 February 2019 02:43 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/9 "2019-02-21T02:43:37Z")

</div>

I have tested in my device by using option --max-old-space-size=20, after running node-red , the free memory can increase to 25M, (before is 5M). But the node-red Performance becomes poor. So can i remove the node-red Built-in nodes(such as not useful)to reduce the running memory?

---

<div class="post-metadata">

**Author:** ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)\
**Post date:** [21 February 2019 03:05 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/10 "2019-02-21T03:05:15Z")

</div>

any other way to reduce the node-red running memory, besides It doesn't degrade performance.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 February 2019 09:19 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/11 "2019-02-21T09:19:50Z")

</div>

you can remove unused nodes if you want to. Removing any core ones may be hard as you would have to rebuild the project without them as they are built into a single minified zip.

---

<div class="post-metadata">

**Author:** ![moebius](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/moebius/32/2872_2.png) [@moebius](https://discourse.nodered.org/u/moebius)\
**Post date:** [21 February 2019 09:28 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/12 "2019-02-21T09:28:36Z")

</div>

or you could use an orange pi zero for 10$...

---

<div class="post-metadata">

**Author:** ![dustinw](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dustinw/32/3426_2.png) [@dustinw](https://discourse.nodered.org/u/dustinw)\
**Post date:** [21 February 2019 17:11 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/13 "2019-02-21T17:11:24Z")

</div>

The latest betas allow Node-red to run without the admin interface. @dceejay would that be a way to save memory?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [21 February 2019 22:08 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/14 "2019-02-21T22:08:00Z")

</div>

No, the latest betas have split up the internal packaging of the runtime and editor. We do not provide a separate executable that is just the runtime - but you could write your own app that embeds the node-red runtime and just runs that. It's a subtle but important distinction - we are _not_ setting out to provide separate runtime and editor executables in the 0.20 release.

But I think the gains would be very marginal. You can already disable the editor through the `disableEditor` property.

You can disable core nodes using the `nodeExcludes` setting - it isn't one we have documented, but we use it in our default IBM Cloud setup to remove the UDP/TCP nodes amongst others - [https://github.com/ibmets/node-red-bluemix-starter/blob/master/bluemix-settings.js#L47](https://github.com/ibmets/node-red-bluemix-starter/blob/master/bluemix-settings.js#L47) - the setting lists the filenames of node that should be ignored. You'd have to pick out the filenames for the nodes you didn't want. But again, the saving would be fairly marginal.

---

<div class="post-metadata">

**Author:** ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)\
**Post date:** [22 February 2019 07:54 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/15 "2019-02-22T07:54:50Z")

</div>

@dceejay @knolleary Thanks for the reply.

Now I have an idea for you to evaluate whether the idea is feasible.

I use a device(Debugging device)with enough memory to complete the programming flow and deployment process.

But only the function of node-red running the flows is required on the actual field device(lots of equipment with memory limit), and other function (such as editing flow, deployment flow and WEB server functions ...)are removed or not running.

Only the Node-red running flows function or environment is preserved and other functions all removed.

Is this feasible?

---

<div class="post-metadata">

**Author:** ![pangda](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pangda](https://discourse.nodered.org/u/pangda)\
**Post date:** [25 February 2019 01:26 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/16 "2019-02-25T01:26:17Z")

</div>

@knolleary @dceejay  
Hi , could you give me some advice? Thanks.

---

<div class="post-metadata">

**Author:** ![odys](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/odys/32/10626_2.png) [@odys](https://discourse.nodered.org/u/odys)\
**Post date:** [17 August 2019 10:20 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/17 "2019-08-17T10:20:53Z")

</div>

Hey @knolleary,

How do we set the disableEditor property in the package.json (node-red runs in container)?

btw, any other memory-reducing tip? --\>[Help - how can I reduce memory footprint of node-red](https://discourse.nodered.org/t/help-how-can-i-reduce-memory-footprint-of-node-red/14376/4)

Thanks!

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [17 August 2019 10:42 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/18 "2019-08-17T10:42:41Z")

</div>

> [@odys](#):
>
> How do we set the disableEditor property in the package.json (node-red runs in container)?

[https://nodered.org/docs/user-guide/runtime/configuration](https://nodered.org/docs/user-guide/runtime/configuration)

---

<div class="post-metadata">

**Author:** ![odys](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/odys/32/10626_2.png) [@odys](https://discourse.nodered.org/u/odys)\
**Post date:** [17 August 2019 11:18 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/19 "2019-08-17T11:18:27Z")

</div>

Thanks for the message @zenofmud, just found out about settings.json. For some reason I thought that package.json was the config file for node-red.

Using dockerfile I will be copying it in /data/, node-red will default to that file or I have to set the full-path as argument in the npm start command (in package.json) .

Thanks!

---

<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:** [17 August 2019 11:47 UTC](https://discourse.nodered.org/t/whether-node-red-supports-clipping-to-reduce-node-red-running-memory/8169/20 "2019-08-17T11:47:45Z")

</div>

Check the logs on node-red start up, it tells you what settings file it's using. But yes, you could specify another on the command line upon launching.

Ps, it's always settings.js (unless you specify alternative settings file)
