JavaScript heap out of memory
maradney opened this issue · comments
Describe the Bug
I've had this issue on multiple servers with different providers where I can't generate on server due to memory issue.
I've solved this before by copying generated files from node_modules on my machine to the repo and pushing it. but this is not a solution.
To Reproduce
Get a vps server and try to deploy.
Mine is this from hostinger. also had similar results with AWS.
![Screenshot 2024-03-03 at 7 31 14 PM](https://private-user-images.githubusercontent.com/20243713/309568500-23a97e32-a7a7-4e6e-a612-7252e705c0c8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIwMTA5NzEsIm5iZiI6MTcyMjAxMDY3MSwicGF0aCI6Ii8yMDI0MzcxMy8zMDk1Njg1MDAtMjNhOTdlMzItYTdhNy00ZTZlLWE2MTItNzI1MmU3MDVjMGM4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI2VDE2MTc1MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ1YjFhZjRlYzQwMmQ4M2MwZTVlMjE4NmUxNWZmNTA1YWNlYjZiNjlmNzg4OWNmYzM4NjQ3NDQwZjFlNTA2NDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.AMr1WhiTmDRkfliEN6FwNjVGJ3hjrUJDRA7YRLaFbdY)
Expected Behavior
To run prisma-generate without issues.
Logs
Generator "typegraphql-prisma" failed:
<--- Last few GCs --->
[2732:0x7111870] 96935 ms: Mark-sweep (reduce) 2036.3 (2083.2) -> 2035.5 (2083.4) MB, 1798.3 / 0.0 ms (average mu = 0.143, current mu = 0.013) allocation failure; scavenge might not succeed
[2732:0x7111870] 98775 ms: Mark-sweep (reduce) 2036.5 (2083.4) -> 2035.7 (2083.7) MB, 1806.6 / 0.0 ms (average mu = 0.083, current mu = 0.018) allocation failure; scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xb87bc0 node::Abort() [node]
2: 0xa96834 [node]
3: 0xd687f0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xd68b97 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xf462a5 [node]
6: 0xf471a8 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [node]
7: 0xf576b3 [node]
8: 0xf58528 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
9: 0xf32e8e v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
10: 0xf34257 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
11: 0xf1542a v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
12: 0x12da78f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
13: 0x170a079 [node]
Aborted (core dumped)
Environment (please complete the following information):
- OS: Ubuntu 23.04 64bit
- Node: 18.18.9
typegraphql-prisma
: "^0.27.0"- Prisma version: "~5.0.0"
- TypeScript version: "4.9.5"
Please generate the code as a source code, so then you can bundle it and ship ready to use js code, without generating it on server.