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
Summary
If the context contains a key which references a Promise, then that context object is never cleared. Hence, the _contexts map keeps growing and hogs up all the heap memory.
If I change the set to namespace.set('x', '') (or any other primitive or object), context is cleared sometimes automatically after every request and always if a manual garbage collection is triggered.
The text was updated successfully, but these errors were encountered:
MayurRJoshi
changed the title
[Memory leak] Context is not cleared if namespace references a Promise
[Memory leak] Context is not cleared if it references a Promise
Jun 1, 2021
Summary
If the context contains a key which references a Promise, then that context object is never cleared. Hence, the
_contexts
map keeps growing and hogs up all the heap memory.Steps to reproduce
express
andcls-hooked
.node --inspect index.js
curl localhost:3030
_contexts
keeps growing even after a manual garbage collectionIf I change the
set
tonamespace.set('x', '')
(or any other primitive or object), context is cleared sometimes automatically after every request and always if a manual garbage collection is triggered.Output with no manual GC.
The text was updated successfully, but these errors were encountered: