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
I'm integrating part of this library in an experiment and ran into this issue.
another potential solution is to add an indicator to the "child" that it was generated by h() so no need to store any global collection. the child could add a property to the html string it returns (not sure if this has browser memory implications and it's kind of hacky).
or instead of returning the string s maybe return lightest possible object structure with a toString() method
e.g. { h: true, toString() { return s; } }
Activity
atlas1119 commentedon Jul 1, 2019
Has it been solved?
developit commentedon Dec 4, 2019
This is still an issue. Switching to a WeakMap would likely help. I opened a PR with a basic implementation.
zhuscat commentedon Jul 21, 2022
It seems like the problem has not been solved yet. Is there any plan? 😭
Switch sanitization to a Set and add cleanup
luwes commentedon Oct 8, 2022
I'm integrating part of this library in an experiment and ran into this issue.
another potential solution is to add an indicator to the "child" that it was generated by
h()so no need to store any global collection. the child could add a property to the html string it returns (not sure if this has browser memory implications and it's kind of hacky).or instead of returning the string
smaybe return lightest possible object structure with atoString()methode.g.
{ h: true, toString() { return s; } }Switch to WeakMap and String objects to avoid memory leak. Fixes deve…
geminigeek commentedon Jul 23, 2025
memory leak still happening , anyone found a fix ?
TimDaub commentedon Oct 21, 2025
Would be good if this was getting fixed, this is taking down a prod server of mine
Fix memory leak by replacing unbounded sanitized cache with LRU cache
Switch to WeakMap with String objects to fix memory leak