You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My system uses the code API to dynamically create various exchanges, queues and bindings, based on configuration data in the system's database. As such, I can't use the wascally.config for more than a few key items in my system.
A few weeks ago, I noticed memory in my system slowly increasing and never decreasing... classic memory leak. After some drilling into things, I have isolated the problem in my app, and it comes down to the API calls for creating exchanges.
As I said, I have to dynamically determine exchanges, queues and bindings at runtime. This means I have to re-declare the exchange (at a minimum) every time I want to send a message. I know this is a performance bottleneck, and I'm ok with that given the relatively low number of messages we send.
But, this code will produce a memory leak.
Every time wascally.addExchange is called, more memory is eaten up and never released.
I'm going to try and dig into the Wascally code to figure out where the problem is. I could certainly use help, though. :)
Instructions To Reproduce The Memory Leak
I'm running OSX 10.11 (El Cap), Node v4.2.1
copy all of the files from this gist into a folder
npm install wascally
node receiver.js
node sender.js
wait until the messages are done processing, then
./send-more.sh (pid) where (pid) is the process id of the sender.js node process
this will send a kill -USR2 $pid signal to the sender, causing it to send another 1,000 messages.
watch the memory usage skyrocket
The text was updated successfully, but these errors were encountered:
My system uses the code API to dynamically create various exchanges, queues and bindings, based on configuration data in the system's database. As such, I can't use the
wascally.config
for more than a few key items in my system.A few weeks ago, I noticed memory in my system slowly increasing and never decreasing... classic memory leak. After some drilling into things, I have isolated the problem in my app, and it comes down to the API calls for creating exchanges.
I've created a gist with a complete sample code set to reproduce the problem.
The gist of the gist, is this code:
As I said, I have to dynamically determine exchanges, queues and bindings at runtime. This means I have to re-declare the exchange (at a minimum) every time I want to send a message. I know this is a performance bottleneck, and I'm ok with that given the relatively low number of messages we send.
But, this code will produce a memory leak.
Every time
wascally.addExchange
is called, more memory is eaten up and never released.I'm going to try and dig into the Wascally code to figure out where the problem is. I could certainly use help, though. :)
Instructions To Reproduce The Memory Leak
I'm running OSX 10.11 (El Cap), Node v4.2.1
npm install wascally
node receiver.js
node sender.js
wait until the messages are done processing, then
./send-more.sh (pid)
where (pid) is the process id of thesender.js
node processthis will send a
kill -USR2 $pid
signal to the sender, causing it to send another 1,000 messages.watch the memory usage skyrocket
The text was updated successfully, but these errors were encountered: