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
if the key of tradeMap is string for number type (user.tradeMap.key also equal to trade.id.toString()), it will made TestModel .schema.subpaths cache the child path (for exanmple ''tradeMap.6.content“、’tradeMap.8.tradeId” etc'). if trade.id keeps increasing, the memory of global variable TestModel will be increasing too.
The content you are editing has changed. Please copy your edits and refresh the page.
The text was updated successfully, but these errors were encountered:
mistyByme
changed the title
mongoose model.schema.subpaths member leak for Map of childSchema
mongoose model.schema.subpaths memory leak for Map of childSchema
Sep 18, 2023
mistyByme
changed the title
mongoose model.schema.subpaths memory leak for Map of childSchema
Using MongooseMap causes memory leak on model.schema.subpaths
Sep 19, 2023
Prerequisites
Mongoose version
7.5.0
Node.js version
18.16.0
MongoDB server version
5.0
Typescript version (if applicable)
4.9.4
Description
model fields for model.schema.subpaths will collect the paht of map childSchema ,it will make the memory bigger and bigger if path changed.
Steps to Reproduce
Expected Behavior
if the key of tradeMap is string for number type (user.tradeMap.key also equal to trade.id.toString()), it will made TestModel .schema.subpaths cache the child path (for exanmple ''tradeMap.6.content“、’tradeMap.8.tradeId” etc'). if trade.id keeps increasing, the memory of global variable TestModel will be increasing too.
Tasks
The text was updated successfully, but these errors were encountered: