Memory leak in couchbase NODE.JS app

I use node v14.15.0 and “couchbase”: “^3.0.7” on my local windows OS
and in the dev server Debian OS is node v14.15. too

I have a problem with large memory using.
For test I made small aplication

couchbase = require(‘couchbase’)
const dbConfig = {
“connectionString”: “couchbase://xx.x.xx.xx”,
“bucketName”: “cpanel”,
“username”: “developer”,
“password”: “%Rerrt3m;”,
}

const cluster = new couchbase.Cluster(dbConfig.connectionString, {
username: dbConfig.username,
password: dbConfig.password,
});
cluster.bucket(dbConfig.bucketName);
(async ()=>{
console.log(“Start”);
console.log( await cluster.query("select * from cms-deploy ") );
})();

And have result https://prnt.sc/vqbg5o

STEST.JS on server usingin 10 times more memory than Windows and memory usage is growing

What is the reason ?

hello @Lenty_Me which version of Debian OS are you using ? Also are you saying that its the same test using Windows vs Debian and are seeing memory growing in Debian OS only ?

Your query seems to be very generic an asterisk and no filters, what is your data size ? Is your application running on a dedicated application server ?

I using Debian 10 and virtual server, but what is link between used memory and virtual server?
I think the problem is in open connection, becouse if I clouse connection memory is down and not grow.
In window OS using memory is in 10x less memory and growing to, but aftersone time memory is reduced

Thanks @Lenty_Me was curious to know if its a supported version of the OS and seems it is.
@brett19 can you please assist ?

Hey @Lenty_Me,

Take a look here for more information about the memory leak and the fix. Note that a workaround is to pass a custom logging function to the Node.js SDK to prevent our automatic use of the debug library (which is where the leak exists); you can also workaround it by explicitly installing the latest debug library version which has a fix (4.3.1); or finally you can pull the master of couchnode which has our own internal fix to avoid the leak. Lastly, the 3.1.0 release should be out sometime in the next 24 hours and containsh both an updated debug library, and our internal fix,

Cheers, Brett

1 Like