# Flowfuse Device Agent crashes. FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

**URL:** <https://discourse.nodered.org/t/flowfuse-device-agent-crashes-fatal-error-reached-heap-limit-allocation-failed-javascript-heap-out-of-memory/96822>\
**Category:** FlowFuse\
**Created:** [30 April 2025 10:11 UTC](https://discourse.nodered.org/t/flowfuse-device-agent-crashes-fatal-error-reached-heap-limit-allocation-failed-javascript-heap-out-of-memory/96822 "2025-04-30T10:11:40Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [30 April 2025 14:40 UTC](https://discourse.nodered.org/t/flowfuse-device-agent-crashes-fatal-error-reached-heap-limit-allocation-failed-javascript-heap-out-of-memory/96822/4 "2025-04-30T14:40:53Z")

</div>

> [@HermanWiid](#):
>
> Node-Red v3.1.8 is bundled with the FF DA installation.

No, the device agent installs the node-red version specified in the device settings or whatever value (if any) is in your target snapshot. So for example, you can override this in device settings -\> node-red -\> version.

> [@HermanWiid](#):
>
> > [@Steve-Mcl](#):
> >
> > First let me state, this is not a FlowFuse issue
> 
> Since I was able to load the flows in Node-Red, outside of the FlowFuse Device Agent environment, it seemed more like that it was a FF issue. My thinking was that somehow the FF DA loader was starting Node-Red with constraining memory parameters.

Actually, that is a valid point. In the launcher file, we do add `--max_old_space_size=512`. What that means is when this heap fills up, Node.js needs to perform a garbage collection (GC) cycle. Coupled with your comment about "now not able to modify flows" (_my mind reads "you have recently modified flows"_) from that, I dont think it is a stretch to conclude _something has changed_ and the GC is now unable able to keep up with memory allocations.

Are you able to try something out? If possible, edit the file `lib/launcher.js` in your device agent installation and change the line to something like '--max\_old\_space\_size=1024' (or remove it altogether)

---

_[View the full topic](https://discourse.nodered.org/t/flowfuse-device-agent-crashes-fatal-error-reached-heap-limit-allocation-failed-javascript-heap-out-of-memory/96822)._
