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

I did set quite high memory in GitLab CI, stated at 8MB but I tried even 14GB, but I still get this error:

NODE_OPTIONS: --max-old-space-size=15032377839

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

We have a super easy script:

stages:
  - build
  - deploy

default:
  image: node

BuildApp:
  stage: build
  before_script:
    - GENERATE_SOURCEMAP=false
  script:
    - yarn
    - yarn prod

PluginSVN:
  stage: deploy
  before_script:
    - apt-get install subversion
    - curl -o /usr/bin/deploy.sh https://git-cdn.e15r.co/open-source/wp-org-plugin-deploy/raw/master/scripts/deploy.sh
    - chmod +x /usr/bin/deploy.sh
  script: /usr/bin/deploy.sh
  when: on_success

It should only execute yarn prod on a reactive WordPress plugin. What do you think is wrong?

End the logs from GILab CI :

<s> [webpack.Progress] 91% sealing chunk assets processing
<s> [webpack.Progress] 92% sealing asset processing
<s> [webpack.Progress] 92% sealing asset processing ts-loader
<s> [webpack.Progress] 92% sealing asset processing TerserPlugin

<--- Last few GCs --->

[198:0x6826110]   336151 ms: Mark-sweep (reduce) 1797.7 (1878.3) -> 1796.6 (1878.6) MB, 4891.5 / 0.0 ms  (average mu = 0.232, current mu = 0.007) allocation failure scavenge might not succeed
[198:0x6826110]   341029 ms: Mark-sweep (reduce) 1798.0 (1878.8) -> 1796.6 (1879.1) MB, 4853.8 / 0.0 ms  (average mu = 0.131, current mu = 0.005) allocation failure scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0xb17ec0 node::Abort() [/usr/local/bin/node]
 2: 0xa341f4 node::FatalError(char const*, char const*) [/usr/local/bin/node]
 3: 0xcfe71e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 4: 0xcfea97 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 5: 0xee8d35  [/usr/local/bin/node]
 6: 0xef7ab1 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
 7: 0xefad0c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
 8: 0xec72bb v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/bin/node]
 9: 0x123052b v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
10: 0x16147d9  [/usr/local/bin/node]
Aborted (core dumped)
error Command failed with exit code 134.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.