# Javascript - heap out of memory in Rasberry Pi

**URL:** <https://discourse.nodered.org/t/javascript-heap-out-of-memory-in-rasberry-pi/61474>\
**Category:** General\
**Created:** [19 April 2022 05:50 UTC](https://discourse.nodered.org/t/javascript-heap-out-of-memory-in-rasberry-pi/61474 "2022-04-19T05:50:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [19 April 2022 10:20 UTC](https://discourse.nodered.org/t/javascript-heap-out-of-memory-in-rasberry-pi/61474/2 "2022-04-19T10:20:15Z")

</div>

There are several things you can do here.

The first would be not to run a desktop on the Pi if that is what you are doing. Unless you have a Pi4 with loads of memory, the Pi's are generally fairly short on memory and a desktop takes up a LOT.

Secondly, you should check how you are running Node-RED. In the past, a parameter was passed `max-old-space` which changes when Node.js performs its garbage collection. If you do have it, try removing it. If you don't have it, try adding it. For the old Pi's, we used to set it to `256`.

There are quite a few threads here in the forum about memory management. Here are a couple but you should use the search function as well.

[Help - how can I reduce memory footprint of node-red - General - Node-RED Forum (nodered.org)](https://discourse.nodered.org/t/help-how-can-i-reduce-memory-footprint-of-node-red/14376/11)

[Analysing Memory Use - FAQs - Node-RED Forum (nodered.org)](https://discourse.nodered.org/t/analysing-memory-use/49953)

There are also a few nodes that help with this:

[bartbutenaers/node-red-contrib-process-resources: A Node-RED node to monitor the resources used by the OS processes (github.com)](https://github.com/bartbutenaers/node-red-contrib-process-resources)

[node-red-contrib-gc (node) - Node-RED (nodered.org)](https://flows.nodered.org/node/node-red-contrib-gc)

There may be others, please do a search in the Flows site.

Another thing that you can do is to remove any contributed nodes that you don't really need.

And then you should check your flows for anything that might be either loading a really large chunk of data or that might not be releasing data.

---

_[View the full topic](https://discourse.nodered.org/t/javascript-heap-out-of-memory-in-rasberry-pi/61474)._
