Closed japrogramer closed 8 months ago
I did try this export NODE_OPTIONS=--max-old-space-size=12000
but it didn't work.
I suspect a memory leak.
I tried building on a machine with 32gb of ram and I still run out of memory.
export NODE_OPTIONS=--max-old-space-size=24096
free -h
total used free shared buff/cache available
Mem: 31Gi 312Mi 24Gi 0.0Ki 6.4Gi 30Gi
Swap: 0B 0B 0B
....
<--- Last few GCs --->
[4832:0x583c370] 107404 ms: Scavenge 2027.7 (2080.8) -> 2020.1 (2080.8) MB, 4.0 / 0.0 ms (average mu = 0.682, current mu = 0.658) allocation failure
[4832:0x583c370] 107438 ms: Scavenge 2027.8 (2080.8) -> 2020.2 (2080.8) MB, 3.7 / 0.0 ms (average mu = 0.682, current mu = 0.658) allocation failure
[4832:0x583c370] 107458 ms: Scavenge 2027.9 (2080.8) -> 2020.3 (2096.8) MB, 4.5 / 0.0 ms (average mu = 0.682, current mu = 0.658) allocation failure
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
1: 0xb090e0 node::Abort() [/home/ubuntu/.nvm/versions/node/v16.20.1/bin/node]
2: 0xa1b70e [/home/ubuntu/.nvm/versions/node/v16.20.1/bin/node]
3: 0xce1a20 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/home/ubuntu/.nvm/versions/node/v16.20.1/bin/node]
4: 0xce1dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/home/ubuntu/.nvm/versions/node/v16.20.1/bin/node]
5: 0xe99435 [/home/ubuntu/.nvm/versions/node/v16.20.1/bin/node]
6: 0xea90fd v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/home/ubuntu/.nvm/versions/node/v16.20.1/bin/node]
7: 0xeabdfe v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/home/ubuntu/.nvm/versions/node/v16.20.1/bin/node]
8: 0xe6d33a v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/home/ubuntu/.nvm/versions/node/v16.20.1/bin/node]
9: 0x11e61e6 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/home/ubuntu/.nvm/versions/node/v16.20.1/bin/node]
10: 0x15d9e59 [/home/ubuntu/.nvm/versions/node/v16.20.1/bin/node]
/home/ubuntu/appscenter/app/client/node_modules/react-scripts/scripts/build.js:19
throw err;
^
RpcIpcMessagePortClosedError: Process 4832 exited [SIGABRT].
at /home/ubuntu/appscenter/app/client/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:19:23
at Generator.next (<anonymous>)
at /home/ubuntu/appscenter/app/client/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:8:71
at new Promise (<anonymous>)
at __awaiter (/home/ubuntu/appscenter/app/client/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:4:12)
at ChildProcess.handleExit (/home/ubuntu/appscenter/app/client/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:18:42)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.emit (node:domain:489:12)
at Process.ChildProcess._handle.onexit (node:internal/child_process:293:12) {
code: null,
signal: 'SIGABRT'
}
for some reason running git clean -dfx
fixes the issue, it seems that the build process creates cache files that create the memory leak in the following builds.
In package.json, start command to modify craco
craco start => craco --max_old_space_size=4096 start
I faced the same issue, tried both of the above commands and added the following to tsconfig.json:
{
// ...
"verbatimModuleSyntax": true,
"ignoreDeprecations": "5.0"
}
I also had to remove "importsNotUsedAsValues": "error"
from tsconfig.json. Now it's working!
I'm having this problem too when i do yarn start on the client, the system becomes unresponsive, Release v1.38
Is there an existing issue for this?
Description
I was able to build the frontend before on this laptop but suddenly on the release branch I can no longer build the frontend despite having lots of memory
Steps To Reproduce
build the frontend code
Public Sample App
No response
Environment
Production
Issue video log
No response
Version
| * 7a9749e49764921d75b1341c743f374481e94b0b (upstream/release) Update top contributors