Skip to content

build(mac): drop webpack heap from 6 GB to 4 GB on the macOS build#9968

Merged
asheshv merged 1 commit into
masterfrom
fix/bundle-heap-4gb
May 22, 2026
Merged

build(mac): drop webpack heap from 6 GB to 4 GB on the macOS build#9968
asheshv merged 1 commit into
masterfrom
fix/bundle-heap-4gb

Conversation

@asheshv
Copy link
Copy Markdown
Contributor

@asheshv asheshv commented May 22, 2026

Summary

  • The 6 GB ceiling set by build(mac): bump webpack heap to 6 GB on the macOS appbundle build #9967 was too aggressive for the macOS x64 VM's total RAM. Build #1295 on pgabf-macos-x64 failed in _build_runtime at unzip electron-vX.X.X-darwin-x64.zip with exit code 2 — never even reached webpack — which points at OS-level memory pressure spilling out of the Node process and starving the rest of the build.
  • Drop the ceiling back to 4 GB, which still gives Terser a full extra gigabyte beyond the original 3 GB setting that OOM-killed webpack in Allow navigation of query history using arrow keys. (RM #2590) #1294, but leaves enough headroom for the other steps in the appbundle build to coexist.
  • Only the macOS appbundle path changes (see pkg/mac/build-functions.sh); linux/pip/Makefile and dev-machine builds keep the 3 GB the bundle npm script ships with.

Caveat

--max-old-space-size is a ceiling, not a reservation, so 6 GB shouldn't strictly have caused the unzip failure unless something else (worker leftover, disk pressure, or a transient flake) was contributing. 4 GB is the safe step back; if the next build still fails at unzip we should look at the worker's free RAM/disk rather than tune the heap further.

Test plan

  • Re-trigger pgadmin4-macos-qa on both macos-x64 and macos-arm64 and confirm the appbundle builds successfully end-to-end.
  • On x64, verify the build clears _build_runtime (electron unzip) without exit code 2.
  • On x64, verify webpack progresses past 92% [0] sealing asset processing TerserPlugin to emitting/done.

Summary by CodeRabbit

  • Chores
    • Adjusted memory configuration for the build process.

Review Change Stack

The 6 GB ceiling set by #9967 was too aggressive for the macOS x64
VM's total RAM. Build #1295 on `pgabf-macos-x64` failed in
`_build_runtime` at `unzip electron-vX.X.X-darwin-x64.zip` with exit
code 2 — never even reached webpack. That points at OS-level memory
pressure spilling out of the Node process and starving the rest of
the build: at 6 GB reserved, the box runs out of RAM long before
Terser actually needs the full ceiling.

Drop back to 4 GB, which still gives Terser a full extra gigabyte
beyond the original 3 GB setting that OOM-killed webpack in #1294,
but leaves enough headroom for the other steps in the appbundle
build to coexist.

Only the macOS appbundle path changes (see pkg/mac/build-functions.sh);
linux/pip/Makefile and dev-machine builds keep the 3 GB the `bundle`
npm script ships with.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 27472430-db82-428a-b197-dc02a873f419

📥 Commits

Reviewing files that changed from the base of the PR and between 3e1921d and 1304c29.

📒 Files selected for processing (1)
  • pkg/mac/build-functions.sh

Walkthrough

The PR reduces the Node.js V8 old-space heap limit in the macOS build process from 6 GB to 4 GB by changing NODE_OPTIONS --max-old-space-size from 6144 to 4096 in pkg/mac/build-functions.sh's _complete_bundle web build step, with supporting comments updated accordingly.

Changes

Node.js memory limit adjustment

Layer / File(s) Summary
Node memory limit configuration
pkg/mac/build-functions.sh
NODE_OPTIONS --max-old-space-size parameter reduced from 6144 MB to 4096 MB in the webpack/lint build executed in the web directory, with inline comments updated to reflect the 4 GB target and OOM/build-failure context.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • pgadmin-org/pgadmin4#9967: Both PRs modify pkg/mac/build-functions.sh's _complete_bundle web build step by changing NODE_OPTIONS's --max-old-space-size heap limit in opposite directions.
  • pgadmin-org/pgadmin4#9965: Both PRs modify pkg/mac/build-functions.sh in _complete_bundle's web build step by changing NODE_OPTIONS memory limit for Node-based lint/webpack commands.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/bundle-heap-4gb

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@asheshv asheshv merged commit 533aed1 into master May 22, 2026
48 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant