[TWENTY_SERVER] Out of memory when `npx nx start twenty-server`
I am getting this
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xb9bbf0 node::Abort() [node]
2: 0xaa27ee [node]
3: 0xd734a0 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [node]
4: 0xd73847 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) [node]
5: 0xf50c55 [node]
6: 0xf51b58 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
7: 0xf62053 [node]
8: 0xf62ec8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0xf3d81e v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
10: 0xf3ebe7 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
11: 0xf1fdea v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
12: 0x12e505f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long, v8::internal::Isolate) [node]
13: 0x1711cb9 [node]
Killed
Warning: command "tsc -b tsconfig.json --incremental" exited with non-zero status code
I have changed NODE_OPTIONS=--max-old-space-size=5120 and VITE_DISABLE_TYPESCRIPT_CHECKER=true and VITE_DISABLE_ESLINT_CHECKER=true , I am using wsl and have a RAM of 8 gb plz help
13 Replies
Hello
What branch are you running on, have you followed all steps from the docs https://twenty.com/developers/section/self-hosting/troubleshooting#while-running-,[object-object],-or-,[object-object],,-out-of-memory-error-is-thrown
yayy i had followed all the steps mentioned and my frontend isnt showing any error , i am using wsl (ubuntu)
Isn't showing ?
i am getting the screen like this

I don't understand what's your issue:
- 1/ Out of memory issue while running your frontend ?
or
- 2/ Unable to reach back-end ?
For
1/
=> Out of memory issue should be adressed in latest main version, please rebase on it
For 2/
=> Seems like your server couldn't start, have you started it using npx nx start twenty-server
?1> I am using the latest code only through the local setup, with ssh git clone
2> when i am running this command( npx nx start twenty-server) i am getting->
SWC Running...Successfully compiled: 2177 files with swc (895.75ms) <--- Last few GCs ---> [22104:0x2137dca0] 47525 ms: Scavenge (reduce) 1899.7 (1936.7) -> 1899.2 (1936.7) MB, 8.2 / 0.0 ms (average mu = 0.134, current mu = 0.020) allocation failure; [22104:0x2137dca0] 47565 ms: Scavenge (reduce) 1899.9 (1936.7) -> 1899.5 (1936.9) MB, 11.7 / 0.0 ms (average mu = 0.134, current mu = 0.020) allocation failure; [22104:0x2137dca0] 47592 ms: Scavenge (reduce) 1900.3 (1936.9) -> 1899.9 (1937.4) MB, 6.1 / 0.0 ms (average mu = 0.134, current mu = 0.020) allocation failure; <--- JS stacktrace ---> FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 1: 0xb9bbf0 node::Abort() [node] 2: 0xaa27ee [node] 3: 0xd734a0 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [node] 4: 0xd73847 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) [node 3>when i am running this command(npx nx start twenty-front) i am getting;- saurav@Saurav-Mishra:~/twenty$ npx nx start twenty-front NX Running target start for project twenty-front and 4 tasks it depends on:
nx run twenty-shared:generateBarrels [existing outputs match the cache, left as is]
nx run twenty-ui:generateBarrels [local cache] nx run twenty-shared:build [existing outputs match the cache, left as is] nx run twenty-ui:build [local cache] nx run twenty-front:startVITE_DISABLE_TYPESCRIPT_CHECKER: true VITE_DISABLE_ESLINT_CHECKER: true VITE_DISABLE_TYPESCRIPT_CHECKER: true VITE_DISABLE_ESLINT_CHECKER: true ➜ Local: http://localhost:3001/ ➜ Network: use --host to expose with a page as i have mentioned above
1> I am using the latest code only through the local setup, with ssh git cloneJust to be sure could you please share latest sha commit of your local main branch Front is working as expected ✅ First time I header memory issue with twenty-server Please try running
npx nx reset
Also could you please share the whole stack trace ?5e43839efbafcdc4f52fa7fc7369352bfbfb7d63
sure




Have you already been able in the past to run Twenty successfully ?
Could you please only run
npx nx build twenty-server
only without anything else running in the background -> front off
Your machine might be short on cpu when having both front and back upNo, I haven't been able to run twenty , i ran the above command its working fine

Ok please then try running
npx nx start twenty-server
only, without starting the front
Let me know if it starts correctlystill shows the same error
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xb9bbf0 node::Abort() [node]
2: 0xaa27ee [node]
3: 0xd734a0 v8::Utils::ReportOOMFailure(v8::internal::Isolate, char const, bool) [node]
4: 0xd73847 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate, char const, bool) [node]
5: 0xf50c55 [node]
6: 0xf51b58 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
7: 0xf62053 [node]
8: 0xf62ec8 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0xf3d81e v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
10: 0xf3ebe7 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
11: 0xf1fdea v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
12: 0x12e505f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long, v8::internal::Isolate) [node]
13: 0x1711cb9 [node]