Skip to content

Add option to specify heap memory limit to underlying JavaScript runtime #367

Open
@pranavpudasaini

Description

@pranavpudasaini

Is your feature request related to a problem? Please describe.
While scanning a repo with 4000+ TypeScript files with a total of 100+ rules, it always crashes with the error: "Fatal JavaScript out of memory: Reached heap limit". I'm using a standard GitHub-hosted runner for private repos with 2 cores and 7 GiB memory to perform the test.

Describe the solution you'd like
It would be awesome if there were an option to specify the maximum heap size for the underlying JavaScript runtime. Could be something equivalent to NODE_OPTIONS=--max_old_space_size=2048.

Describe alternatives you've considered
I've tried specifying heap size by adding the command prefix NODE_OPTIONS=--max_old_space_size=2048 to the datadog-static-analyzer binary but the JS runtime doesn't seem to use it.

image

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions