Skip to content

Commit

Permalink
generate.py: fix build on 32 bit system (project-chip#36942)
Browse files Browse the repository at this point in the history
setting max-old-space-size to more than 4GB cause node to fail instantly
on 32 bit systems, even to run zap-cli --version.

Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
symphorien and andy31415 authored Jan 7, 2025
1 parent daf2c42 commit 354e43d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/tools/zap/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,9 @@ def main():
if cmdLineArgs.runBootstrap:
subprocess.check_call(getFilePath("scripts/tools/zap/zap_bootstrap.sh"), shell=True)

# The maximum memory usage is over 4GB (#15620)
os.environ["NODE_OPTIONS"] = "--max-old-space-size=8192"
# on 64 bit systems, allow maximum memory usage to go over 4GB (#15620)
if sys.maxsize >= 2**32:
os.environ["NODE_OPTIONS"] = "--max-old-space-size=8192"

# `zap-cli` may extract things into a temporary directory. ensure extraction
# does not conflict.
Expand Down

0 comments on commit 354e43d

Please sign in to comment.