Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could this cause a Memory Leak ? #96

Open
debianw opened this issue Nov 1, 2018 · 1 comment
Open

Could this cause a Memory Leak ? #96

debianw opened this issue Nov 1, 2018 · 1 comment

Comments

@debianw
Copy link

debianw commented Nov 1, 2018

this._contents = []

I'm doing a benchmark of my API ( endpoints are logging traffic and sending them to CloudWatch ) and the amount of memory used increase. After benchmark test finish I see that API still continue working sending logs and seems this task almost never ends.

Seems to me that the Queue used by this module is accumulating logs or objects keeping the node single thread busy trying to purge the queue. I just noticed this module use bottleneck module as a dependency.

I think winston-aws-cloudwatch is not performing well when your API receives tons of requests.

@timdp
Copy link
Owner

timdp commented Nov 5, 2018

The behavior should be that it periodically flushes the queue. Of course, if you throw a lot of data at it, it's still going to accumulate that in memory. If it then gets throttled by the CloudWatch API as well, memory is going to get saturated. That said, once items have been flushed from the queue, they should be marked for garbage collection. Thus, as long as flushing is able to keep up with how much data you put in, I see no reason why it would leak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants