node-redis
node-redis copied to clipboard
Memory Leak when using brpop
I've this piece of code which is causing memory leaks.
var redis = require("redis");
var util = require("util");
client = redis.createClient();
var brpopAsync = util.promisify(client.brpop).bind(client);
setInterval(() => {
process.nextTick( async () => {
const data = await brpopAsync('testlist', 5);
})
}, 200);
I inspected the code using chrome debugger and saw that this indeed is a closure leak. However, if I replace the brpop with rpop I don't get any memory leak. I'm trying to understand what's the issue with using brpop. How can brpop be used efficiently.
Environment
- Node.js Version:
v10.16.0
- Redis Version:
4.0.9
- Platform:
Mac OSX, Amazon Linux
any updates on this?