Skip to content
Back

JavaScript heap out of memory during build on Appwrite sites

  • 0
  • Self Hosted
  • Sites
deep
4 Dec, 2025, 15:11

I am running into heap out of memory when I am trying to build an Appwrite site. Usually this can be fixed by modifying the max-old-space-size configuration, but as far as I know, there is no way to do that in Appwrite sites.

Also the server usage is not a lot, it has a 16GB memory and less than 4GB memory is used by Appwrite even when building the site. Each core also has less than 10% usage.

I also checked the environment variables, and both _APP_COMPUTE_CPUS and _APP_COMPUTE_MEMORY are unrestricted.

TypeScript
[log] [nuxi] Nuxt 3.17.7 (with Nitro 2.12.9, Vite 6.4.1 and Vue 3.5.25)
[info] [nuxt:tailwindcss] Using default Tailwind CSS file
[info] [nuxi] Building for Nitro preset: `node-listener`
[info] Building client...
[info] vite v6.4.1 building for production...
[info] transforming...

<--- Last few GCs --->

[93:0x7f36a1c10000] 94416 ms: Mark-Compact 1010.2 (1043.2) -> 1002.6 (1043.7) MB, pooled: 0 MB, 1889.16 / 0.04 ms (average mu = 0.148, current mu = 0.137) allocation failure; scavenge might not succeed
[93:0x7f36a1c10000] 96338 ms: Mark-Compact 1009.7 (1043.7) -> 1003.4 (1044.2) MB, pooled: 0 MB, 1528.53 / 0.03 ms (average mu = 0.174, current mu = 0.205) task; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

bash: line 1: 82 Aborted (core dumped) npm run build
TL;DR
Issue: JavaScript heap out of memory error during build on Appwrite sites. Possible Solution: Since modifying the `max-old-space-size` may not be feasible in Appwrite sites, consider optimizing the build process by splitting large tasks into smaller ones or reducing memory consumption in the code. Check for memory leaks and inefficient code that could be causing the heavy memory usage during the build process.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more