-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Memory leak detected. #18
Comments
Hi @pmiotto thanks for reporting this. how to reproduce like that? |
HI @ikhsanalatsary. I've got an endpoint which uploads an image and a couple of resizes to S3, you can use a tool like jMeter to perform a loadtest. It fails under 10 concurrent requests. Not only I get this memory leak but some images uploaded to S3 are 0kb. |
@pmiotto could you share your JMeter configuration? |
My configuration |
Hello Dear, Any solution for this case ? |
This is expected to happen because you have many unused variables. Start by eliminating the unused variables from your code. |
I am also having this issue. It is because I am having a long resize set. Is there a way to do this in a way of asynchronous calls (Promisse.all or something like that) to relieve the EventEmitter ? |
I have increased for now the event emitter with |
Of course it can be promisified easily, and if not, then it should! |
I agree it should be promisified. I'll take a look at the src code after working hours, it would be best to implement it there |
Hi.
It seems that when uploading an image with multiple resizes causes memory leaks under a small load. I've performed a load test using this library and it fails around 15 concurrent requests. Here's the error stack. Any help would be appreciated.
MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added. Use emitter.setMaxListeners() to increase limit
at _addListener (events.js:247:17)
at Sharp.addListener (events.js:263:10)
at Sharp.Readable.on (_stream_readable.js:800:35)
at ManagedUpload.send (/Users/me/Documents/wip/project/node_modules/aws-sdk/lib/s3/managed_upload.js:185:11)
at /Users/me/Documents/wip/project/node_modules/aws-sdk/lib/util.js:798:25
at new WrappedPromise (/Users/me/Documents/wip/project/node_modules/async-listener/es6-wrapped-promise.js:13:18)
at ManagedUpload.promise (/Users/me/Documents/wip/project/node_modules/aws-sdk/lib/util.js:797:14)
at MergeMapSubscriber.sizes.pipe.operators_1.mergeMap [as project] (/Users/me/Documents/wip/project/node_modules/multer-sharp-s3/dist/main.js:113:52)
at MergeMapSubscriber._tryNext (/Users/me/Documents/wip/project/node_modules/rxjs/internal/operators/mergeMap.js:69:27)
at MergeMapSubscriber._next (/Users/me/Documents/wip/project/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
at MergeMapSubscriber.Subscriber.next (/Users/me/Documents/wip/project/node_modules/rxjs/internal/Subscriber.js:66:18)
at MergeMapSubscriber.notifyNext (/Users/me/Documents/wip/project/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
at InnerSubscriber._next (/Users/me/Documents/wip/project/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
at InnerSubscriber.Subscriber.next (/Users/me/Documents/wip/project/node_modules/rxjs/internal/Subscriber.js:66:18)
at /Users/me/Documents/wip/project/node_modules/rxjs/internal/util/subscribeToPromise.js:7:24
at propagateAslWrapper (/Users/me/Documents/wip/project/node_modules/async-listener/index.js:504:23)
at /Users/me/Documents/wip/project/node_modules/async-listener/glue.js:188:31
at /Users/me/Documents/wip/project/node_modules/async-listener/index.js:541:70
at /Users/me/Documents/wip/project/node_modules/async-listener/glue.js:188:31
The text was updated successfully, but these errors were encountered: