# FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

**URL:** https://meta.discourse.org/t/fatal-error-reached-heap-limit-allocation-failed-javascript-heap-out-of-memory/288543
**Category:** Self-hosting
**Created:** [December 12, 2023, 7:29am UTC](https://meta.discourse.org/t/fatal-error-reached-heap-limit-allocation-failed-javascript-heap-out-of-memory/288543 "2023-12-12T07:29:17Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mholt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mholt/32/120935_2.png) [@mholt](https://meta.discourse.org/u/mholt)
#### Post date: [December 12, 2023, 7:29am UTC](https://meta.discourse.org/t/fatal-error-reached-heap-limit-allocation-failed-javascript-heap-out-of-memory/288543/1 "2023-12-12T07:29:17Z")

</div>

[Rebuild failure: "extconf failed, exit code 1" -- due to old Docker?](https://meta.discourse.org/t/rebuild-failure-extconf-failed-exit-code-1-due-to-old-docker/287756)

I’m getting this too, and now our forum is offline 🤔

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 12, 2023, 7:50am UTC](https://meta.discourse.org/t/fatal-error-reached-heap-limit-allocation-failed-javascript-heap-out-of-memory/288543/2 "2023-12-12T07:50:48Z")

</div>

Do you have a very old Docker version?

Can you run `./launcher start app `

To restart?

---

<div class="post-metadata">

### Author: ![mholt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mholt/32/120935_2.png) [@mholt](https://meta.discourse.org/u/mholt)
#### Post date: [December 13, 2023, 3:48am UTC](https://meta.discourse.org/t/fatal-error-reached-heap-limit-allocation-failed-javascript-heap-out-of-memory/288543/3 "2023-12-13T03:48:34Z")

</div>

Ok, we’re back online now. Our Ubuntu system was fully up-to-date but for some reason the Docker version was years old still.

Runnning `./launcher start app` didn’t help. The only thing that fixed it was `/var/discourse/discourse_doctor` but when I ran it my SSH session froze. Another maintainer ran it and it succeeded and solved the problem. 🤷‍♂️

Apparently it ran out of memory:

> FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

I’m not sure why it should take more than 2 GB of RAM to run/compile (?) JS…? Any chance it could be made leaner?

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [December 13, 2023, 5:21am UTC](https://meta.discourse.org/t/fatal-error-reached-heap-limit-allocation-failed-javascript-heap-out-of-memory/288543/4 "2023-12-13T05:21:17Z")

</div>

I’ve seen a fair bit of rebuilds failing even on 8GB RAM where a SWAP was not configured. If this server doesn’t have swap, it might be worth setting up a 2GB swap then rebuilding again.

---

<div class="post-metadata">

### Author: ![mholt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mholt/32/120935_2.png) [@mholt](https://meta.discourse.org/u/mholt)
#### Post date: [December 13, 2023, 2:40pm UTC](https://meta.discourse.org/t/fatal-error-reached-heap-limit-allocation-failed-javascript-heap-out-of-memory/288543/5 "2023-12-13T14:40:24Z")

</div>

We already had swap space configured.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [December 13, 2023, 4:27pm UTC](https://meta.discourse.org/t/fatal-error-reached-heap-limit-allocation-failed-javascript-heap-out-of-memory/288543/6 "2023-12-13T16:27:41Z")

</div>

There have been a few reports of `JavaScript heap out of memory` recently, and a change has been made to account for it (all being well 🤞 🙂)

[https://github.com/discourse/discourse/pull/24850](https://github.com/discourse/discourse/pull/24850)

I don’t think your issue is the same as the one in the OP so I’ll split this off into a new topic. 👍
