-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
WxMpConfigStorageHolder中ThreadLocal的内存泄露风险。 #1430
Comments
其实你这个问题跟这个相关,#1218 |
极端情况下是会出现内存泄漏的风险,但是一般更多可能会出现脏数据问题 |
这个其实需要自己的程序在适当位置手动调用remove方法,稍后提供个方法 |
binarywang
added a commit
that referenced
this issue
Mar 12, 2020
一般情况下,使用LocalThread变量的话,如果没有办法做好移除的封装,则需要给用户提供相应的移除方式,希望项目成员可以看看是不是还有其他地方出现类似的情况。感谢各位贡献的代码。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
简要描述
关于ThreadLocal变量的内存泄露风险。
模块版本情况
详细描述
各位辛苦了。今天在看该项目的源码时,发现项目的WxMpConfigStorageHolder使用ThreadLocal作为同一线程的参数传递中间媒介,只看到了对该WX_MP_CONFIG_STORAGE_CHOSE变量的设置操作,未见该变量的remove行为,可能在下才疏学浅,未能明白该段代码是如何避免出现“ThreadLocal”变量的内存溢出风险的,未做ThreadLocal的remove行为。如果我的问题不存在,麻烦告知在下,这种方式为什么不存在问题。希望各位能抽出宝贵的时间回答,谢谢,辛苦了。
日志
无
The text was updated successfully, but these errors were encountered: