# Anlaysing NodeRED memory - problem "Referenceerror: process is not defined"

**URL:** <https://discourse.nodered.org/t/anlaysing-nodered-memory-problem-referenceerror-process-is-not-defined/57904>\
**Category:** General\
**Created:** [7 February 2022 07:43 UTC](https://discourse.nodered.org/t/anlaysing-nodered-memory-problem-referenceerror-process-is-not-defined/57904 "2022-02-07T07:43:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lostbits](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lostbits/32/43407_2.png) [@lostbits](https://discourse.nodered.org/u/lostbits)\
**Post date:** [7 February 2022 07:43 UTC](https://discourse.nodered.org/t/anlaysing-nodered-memory-problem-referenceerror-process-is-not-defined/57904/1 "2022-02-07T07:43:31Z")

</div>

Hey there,

I am using NodeRED 2.2.0 with nodeJS 16.3 on 2 machines using windows 10. On both machines I like to analyze the memory consumption, since I sometimes see a heap error like this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/6/56992f84d57b5bfe797717544363750b4a910cc2.png)

Since there is a pretty good hint in the [FAQ](https://discourse.nodered.org/t/analysing-memory-use/49953) to this, I generated the following Flow:

```auto
[{"id":"da3d35e1314f395a","type":"inject","z":"ec5785f02d0d6ea6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":260,"y":480,"wires":[["1b4aac38a3d0cd92"]]},{"id":"1b4aac38a3d0cd92","type":"function","z":"ec5785f02d0d6ea6","name":"GetMem","func":"\nlet mem = process.memoryUsage()\nconst formatMem = (m) => (m / 1048576).toFixed(2)\n\nmsg.topic = 'Memory Use (MB)'\nmsg.payload = {\n Residentset: formatMem(mem.rss),\n HeapUsed: formatMem(mem.heapUsed),\n HeapTotal: formatMem(mem.heapTotal),\n 'External C++': formatMem(mem.external),\n Unit:\"MB\"\n}\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"process","module":"process"}],"x":400,"y":480,"wires":[["24ec3a426815da70"]]},{"id":"24ec3a426815da70","type":"debug","z":"ec5785f02d0d6ea6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":550,"y":480,"wires":[]}]

```

On my first machine, it runs fine. On the 2nd machine - with NodeRED I get the following error:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/9/199f8ad675d8716a8079b4ced4f6328b220a2f38.png), although the basic function like described in the FAQ (also using process) at the first start of NodeRED runs fine.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/8/b8e54367fae6f88be356672a7ef2f18ee25cd07f.jpeg)

I wonder, why on one machine it works and on the other not.

Any tips are most welcome.

---

<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:** [8 April 2022 07:43 UTC](https://discourse.nodered.org/t/anlaysing-nodered-memory-problem-referenceerror-process-is-not-defined/57904/2 "2022-04-08T07:43:39Z")

</div>

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