After a few days working on Salesforce integration, I finnally finished a simple CLI edtion of DataLoader using prune TypeScript. Within lots of CSV rows loaded into memory, the node engine always crashs around 130k of records. In order to get this job done as quick as possible, I have to increase the max memory of Node.js.

The error message looks like:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory


[1]    15759 abort      node ...

The quick but not perfect solution is:

export NODE_OPTIONS="--max_old_space_size=<memory in MB>"


node --max-old-space-size=<memory in MB> ...

See also: