Skip to content

Commit

Permalink
Add option for running imba scripts with a memory limit
Browse files Browse the repository at this point in the history
  • Loading branch information
somebee committed Jun 14, 2023
1 parent 4c92d45 commit 53f6cd5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/imba/bin/imba.imba
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ def common cmd
common(cli.command('run [script]', { isDefault: true }).description('Imba'))
.option("-i, --instances [count]", "Number of instances to start",fmt.i,1)
.option("--inspect", "Debug")
.option("--memlimit <bytes>", "Set the memory limit of the process")
.action(run)

common(cli.command('build [script]').description('Build an imba/js/html entrypoint and their dependencies'))
Expand Down
1 change: 1 addition & 0 deletions packages/imba/src/bundler/runner.imba
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class WorkerInstance
execArgv: [
o.inspect and '--inspect',
(o.sourcemap or bundle.sourcemapped?) and '--enable-source-maps'
o.memlimit and `--max_old_space_size={o.memlimit}`
].filter do $1
}

Expand Down

0 comments on commit 53f6cd5

Please sign in to comment.