4Science / dspace-angular

Angular UI for DSpace and DSpace-CRIS. In the dspace-cris-7 branch you can find the extension to support DSpace-CRIS
BSD 3-Clause "New" or "Revised" License
14 stars 28 forks source link

improve build:ssr by passing max_old_space_size to ng run command #44

Closed saschaszott closed 1 month ago

saschaszott commented 1 year ago

This PR extends the heap space adjustment in build:ssr to the second ng run comannd.

We have seen reproducable out-of-memory error when building the Docker image. The error occurs after the successful completion of the first command in build:ssr (which is already adjusted in terms of available heap space).

Output when running docker build:

251.9 - Generating server application bundles (phase: setup)...
409.6 ✔ Server application bundle generation complete.
421.3
421.3 <--- Last few GCs --->
421.3
421.3 [38:0xffff94cae330]   171120 ms: Mark-sweep (reduce) 1982.9 (2076.8) -> 1982.9 (2075.8) MB, 707.9 / 0.0 ms  (average mu = 0.227, current mu = 0.000) allocation failure; GC in old space requested
421.3 [38:0xffff94cae330]   171706 ms: Mark-sweep (reduce) 1986.2 (2078.5) -> 1983.2 (2078.5) MB, 477.8 / 0.0 ms  (average mu = 0.211, current mu = 0.185) allocation failure; GC in old space requested
421.3
421.3
421.3 <--- JS stacktrace --->
421.3
421.3 FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
421.7 error Command failed with signal "SIGABRT".
421.7 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
422.0 error Command failed with exit code 1.
422.0 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
------
failed to solve: process "/bin/sh -c yarn build:prod" did not complete successfully: exit code: 1
floriangantner commented 1 month ago

has been meanwhile fixed in https://github.com/4Science/dspace-angular/blob/dspace-cris-2023_02_x/package.json#L21C36-L21C110