-
Notifications
You must be signed in to change notification settings - Fork 592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ConfigProvider]ConfigProvider 在 SSR 的场景下会发生内存泄漏 #2920
Comments
youluna
added a commit
that referenced
this issue
Apr 23, 2021
next/src/config-provider/index.jsx Lines 170 to 180 in 17a0af0
带来的副作用 |
youluna
added a commit
that referenced
this issue
Apr 25, 2021
2个思路来解决: ======== |
youluna
added a commit
that referenced
this issue
Apr 25, 2021
youluna
added a commit
that referenced
this issue
Apr 25, 2021
ConfigProvider 没提供 clearCache 的 types. 还需要修改一下 |
jerryyxu
pushed a commit
to jerryyxu/next
that referenced
this issue
Apr 28, 2021
jerryyxu
pushed a commit
to jerryyxu/next
that referenced
this issue
Apr 29, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Component
ConfigProvider
Steps to reproduce
在 SSR 服务的压测下,我们发现 ConfigProvider 的内置缓存会发生内存的增长,没办法被 GC 掉
通过翻阅源码之后发现,虽然 这里 会在
componentWillUnmount
中移除掉这个缓存,但是在 React Issue 里面发现 facebook/react#3714 发现在 SSR 的场景下面并不会执行componentWillUnmount
的生命周期。所以看看能不能提供出来一个手动清除缓存的 API 或者 其他更好的手段去回收 ConfigProvider 里面的缓存。
The text was updated successfully, but these errors were encountered: