newman: Fatal memory error with large response
-
Newman Version (can be found via
newman -v
): 4.1.0 -
OS details (type, version, and architecture): Alpine Linux 3.7.0, in docker container
-
Are you using Newman as a library, or via the CLI? CLI
-
Did you encounter this recently, or has this bug always been there: Recently
-
Expected behaviour: No timeouts during long collection or test script execution when options are omitted. No out-of-memory errors
-
Command / script used to run Newman: newman run ./collections/$COLLECTION_NAME.json -e ./env/$ENV_NAME.json
-
Sample collection, and auxiliary files (minus the sensitive details):
-
Screenshots (if applicable):
Steps to reproduce the problem:
- Run attached collection (JSON, saved with bogus .txt extension). Randomly selected large JSON file from the internet.
→ get_all_episodes
GET https://raw.githubusercontent.com/zemirco/sf-city-lots-json/master/citylots.json [200 OK, 21.79MB, 19.4s]
<--- Last few GCs --->
[1:0x55698c4e2000] 28027 ms: Mark-sweep 655.2 (666.6) -> 439.2 (450.6) MB, 280.1 / 0.0 ms (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 3337 ms) allocation failure GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x4c364725ee1 <JSObject>
1: toJSON [buffer.js:~938] [pc=0x15daddbc657d](this=0x2d8a4dcf68d1 <Uint8Array map = 0xee6886417b9>)
3: /* anonymous */ [/usr/lib/node_modules/newman/node_modules/postman-collection/lib/collection/property-base.js:133] [bytecode=0x17720956b749 offset=100](this=0x3b2e4f48bde9 <JSGlobal Object>,accumulator=0x2d8a4dc84931 <Object map = 0x21f9f4330a39>,value=0x2d8a4dcf68d1 <Uint8Array map = 0...
FATAL ERROR: invalid array length Allocation failed - JavaScript heap out of memory
I noticed this problem initially when a job was failing with Script execution timed out
, but adjusting timeout settings and upgrading to 4.10.0 to use its default Infinite setting didn’t help.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (5 by maintainers)
This issue still exists. This is a VM with 10GB of ram with NODE_OPTIONS=“–max-old-space-size=8192”. The response is a file of 137.98MB. The file is downloaded, but then we get the fatal memory error. Smaller responses are fine.
$ newman -v 5.2.2
$ node -v v14.16.0
Another customer has experienced a similar issue. They have tried the following and the problem still persists. I have attached a .txt of the error output as well.
@shamasis The mentioned problem is still reproducable, even with node v11 Do you have any other suggestions to us, to solve this unfortunate issue?