Change:
"update-distro": "node build/npm/update-distro.mjs", "web": "echo 'yarn web' is replaced by './scripts/code-server' or './scripts/code-web'", "compile-cli": "gulp compile-cli", <del> "compile-web": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js compile-web", "watch-web": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js watch-web", "watch-cli": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js watch-cli", </del> <ins> "compile-web": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js compile-web", "watch-web": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js watch-web", "watch-cli": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js watch-cli", </ins> "eslint": "node build/eslint", "stylelint": "node build/stylelint", "playwright-install": "node build/azure-pipelines/common/installPlaywright.js", <del> "compile-build": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js compile-build", "compile-extensions-build": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js compile-extensions-build", "minify-vscode": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js minify-vscode", "minify-vscode-reh": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js minify-vscode-reh", "minify-vscode-reh-web": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js minify-vscode-reh-web", "hygiene": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js hygiene", "core-ci": "node --max_old_space_size=8095 ./node_modules/gulp/bin/gulp.js core-ci", "core-ci-pr": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js core-ci-pr", "extensions-ci": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js extensions-ci", "extensions-ci-pr": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js extensions-ci-pr", </del> <ins> "compile-build": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js compile-build", "compile-extensions-build": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js compile-extensions-build", "minify-vscode": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js minify-vscode", "minify-vscode-reh": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js minify-vscode-reh", "minify-vscode-reh-web": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js minify-vscode-reh-web", "hygiene": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js hygiene", "core-ci": "node --max-old-space-size=8095 ./node_modules/gulp/bin/gulp.js core-ci", "core-ci-pr": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js core-ci-pr", "extensions-ci": "node --max-old-space-size=8095 ./node_modules/gulp/bin/gulp.js extensions-ci", "extensions-ci-pr": "node --max-old-space-size=4095 ./node_modules/gulp/bin/gulp.js extensions-ci-pr", </ins> "perf": "node scripts/code-perf.js" }, "dependencies": {

Discussion:
Builds:
fyi
Attempting a fix by simply doubling the max memory available to V8.
Again in
Then I'm out of ideas. we might need to split all those mangling tasks into independent processes, if memory limits are being hit.
Are we sure that we are on the right track here? According to my counting (below) we have only a tenth of the code in extensions (compare to the src-folder) so I wonder why mangling would eat up so much memory here?
I am not sure OOM is the symptom here actually, just my best hunch, but it seems is indeed the problem: <img width="913" alt="image" src=""
Added a every 1 second log of memory usage to this task: Build running:
Created to log the memory usage after each mangling step
lol - similar idea here:
I think we are on to something here. The memory is growing a lot, maybe some state leaks when mangling the next extension. Each extension is its own tsconfig and mangling context. This shouldn't pile up but memory should be released inbetween
Can you take a look at this? I put my money on this which keeps its mangler around. Looks like we need some webpack hook to dispose that loader
I gave it a stab at for which I have confidence, running locally shows how memory is growing and shrinking! This isn't a webpack change but just some cleanup in the mangler itself
!