Commit 0ea736e
authored
fix: memory leak from
The `warnOnce()` function is used to warn only once time, however this
means we might be storing every possible message in memory forever (aka
memory leak) since it can grow unbounded.
This PR changes the behavior to only store only 10KB in a Least Recently
Used (LRU) cache.
The tradeoff here is that you might see the same warning twice if you
have a lot of unique warnings.warnOnce() (#73483)1 parent 432d119 commit 0ea736e
1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 80 | + | |
83 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
0 commit comments