Increase the JavaStack heap memory for protractor

2019-07-15 05:46发布

问题:

I am running test cases using protractor, but sometimes I'm facing error

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

How can I increase the Javascript Heap size of protractor?

I read about --max-old-space-size, buthow this parameter can be set in protractor?

回答1:

If your Nodejs is v8.0.0 or later, you can set it by Environmen Variable: NODE_OPTIONS

For linux:

NODE_OPTIONS="--max-old-space-size=512"

For windows:

More detail look at here



回答2:

set NODE_OPTIONS="--max-old-space-size=4096"

(or)

export NODE_OPTIONS="--max-old-space-size=4096"