Newman: Memory leaks over multiple iterations of Newman.run

Created on 11 Apr 2018  路  4Comments  路  Source: postmanlabs/newman

  1. Newman Version (can be found via newman -v): 3.8.3
  2. OS details (type, version, and architecture): Win 7 Enterprise SP1
  3. Are you using Newman as a library, or via the CLI? Using as a library
  4. Did you encounter this recently, or has this bug always been there: encountered recently but after spinning cycles with existing code
  5. Expected behaviour: No memory leaks or spike in heapUsed
  6. Command / script used to run Newman: Newman.run
  7. Sample collection, and auxiliary files (minus the sensitive details):

Newman run options.txt

Newman run code snippet.txt

memoryLeakTrace.txt

This is just a simple collection with a call to a url that does not exists thereby generating an error.
I am iterating it in soak cycles, each cycle generates a memory spike of around 2.9-3 MB and does not release it.
After first run heapUsed is 8.8 mb and after tenth run it reaches 20.45 mb.

Each run cycle is run with pre-generated option set

I have implemented a small heapUse tracer along with the Newman run code Newman.run.code.snippet.txt

For memory trace for ten iterations Refer memoryLeakTrace.txt

I also implemented a recursive event emitter gc util but it did not help much.

Already an existing issue with similar behavior was logged but closed

Is this an issue with Newman module run function else how may I fix this.

feature request performance runtime

Most helpful comment

@r3ticuli In that case, a way to fix this would be to add a 'light mode' flag that disables aggregation and only holds data for the current request.

All 4 comments

Hey @mailtogj, a linear increase in consumed memory is expected behaviour at the moment, as collection run statistics are built up over the course of a run, in order to aggregate statistics, etc. However, I'll go ahead and run memory leak checks to be completely certain.

Hi @kunagpal ,

I'm trying to use newman in an AWS lambda, and this "statistical aggregation" default setting may be the reason why I keep butting heads with the allocated lambda memory limit. Is there a way to disable this setting?

@r3ticuli In that case, a way to fix this would be to add a 'light mode' flag that disables aggregation and only holds data for the current request.

Closing as duplicate of #941

Was this page helpful?
0 / 5 - 0 ratings