-
Type: Bug
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.6.3
-
Component/s: Native
-
Empty show more show less
I have notices that the amount of memory used by a nodejs process increases over time when I connect to a DB using a basic connection.
The code I am executing is as follows:
const MongoClient = require('mongodb').MongoClient;
const url = "mongodb://xxx:yyy@zzz:27017/testdb?authSource=admin";}}{{
new MongoClient(url, { useNewUrlParser: true, keepAlive: true, useUnifiedTopology: true }).connect();
I have kept an eye on the activity monitor over time, there are two processes spawned and the initial memory usage was 56MB and 36.9MB.
After two days the memory usage was 640MB and 39.1MB.
I have executing this on both MacOS and Windows and am seeing the same issue.
I am using the MongoDB driver version 3.6.3 and have tried on NodeJS 14.15.1 and 15.6.0 with the same result
We are using this in a production environment, and first noticed it because the servers were running out of memory after being up for some time.
I have taken some heap snapshots if that helps:
Snapshot 15th Jan
Snapshot 17th Jan