FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory when processing large files with fs

I have finally found the solution to the problem ! I need to launch the process adding the --max-old-space-size=8192 param to node process:

node --max-old-space-size=8192 ./myScript.js

I processed my 1.3GB without a problem !!


You can increase the amount of memory allocated to the command by running the following command prior to running Snyk:

Linux/macOS

export NODE_OPTIONS=--max-old-space-size=8192 For example:

export NODE_OPTIONS=--max-old-space-size=8192 snyk test export NODE_OPTIONS=--max-old-space-size=8192 snyk monitor

Windows

From the control panel go to System -> Advanced system settings -> Environment Variables -> New (user or system)

enter image description here