Mongoose: memory leak in 5.9.0

Created on 12 Mar 2020  路  4Comments  路  Source: Automattic/mongoose

I don't have a smaller repro case, but I can describe our code.

Our server starts up and creates a mongoose connection pool that's used throughout the application (mostly with feathers mongoose on top of it). We use:

useNewUrlParser: true,
useCreateIndex: true,
useFindAndModify: false,
useUnifiedTopology: true,
poolSize: 5

Under 5.9.0, roughly every 3 hours regardless of load (including nearly no load) the app fails with "JavaScript heap out of memory" errors. There's no pattern to what calls trigger this, indicating an overall leak. This is with the default --max-old-space-size in the node vm.

Reverting back to 5.8.4 (the last version that did not have other bugs that affected our software), we have no such leak issue. The software can run for much longer (at least several weeks, where we usually deploy new versions.)

I haven't been able to capture details yet on the leak, but wanted to post this in case others have seen anything similar.

node 12.16.1
mongoose 5.9.0
mongodb 4.2.0

needs clarification

Most helpful comment

Very curious. I just came here to check if, by any luck, somebody was also experiencing memory leaks with mongoose 5.9.x and I find this issue.

In my case, I'm using version 5.9.3 and I have just downgraded back to 5.8.9 to check if things go back to normal again.

All 4 comments

Very curious. I just came here to check if, by any luck, somebody was also experiencing memory leaks with mongoose 5.9.x and I find this issue.

In my case, I'm using version 5.9.3 and I have just downgraded back to 5.8.9 to check if things go back to normal again.

Seems like same issue with 5.9.4 here.

Without any sort of code samples there's nothing I can do. If you can post any repro instructions, that would be helpful. Otherwise I'm just going to have to close this issue.

understood.

Was this page helpful?
0 / 5 - 0 ratings