Skip to content
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

是否会由上下文传递过程引入内存泄漏 #140

Closed
dictionaryshi opened this issue May 20, 2019 · 1 comment
Closed

是否会由上下文传递过程引入内存泄漏 #140

dictionaryshi opened this issue May 20, 2019 · 1 comment
Assignees
Labels
duplicate ❓question Further information is requested

Comments

@dictionaryshi
Copy link

咨询下, 子线程自动拷贝了父线程中的变量, 那么一般子线程不考虑主动删除拷贝过来的变量,是不是有内存泄漏的风险呢。

@dictionaryshi dictionaryshi changed the title 关于线程泄漏的问题 关于内存泄漏的问题 May 20, 2019
@oldratlee oldratlee self-assigned this May 22, 2019
@oldratlee oldratlee added the ❓question Further information is requested label May 22, 2019
@oldratlee
Copy link
Member

oldratlee commented May 22, 2019

一般子线程不考虑主动删除拷贝过来的变量,是不是有内存泄漏的风险

子线程中 执行的过程是:

  • Replay:重放父线程过来的上下文。框架完成,不受业务影响。
  • 执行业务逻辑
  • Restore: 恢复成执行前自己上下文。框架完成,不受业务影响。
    这一步执行完成的结果是,不再引用释放父线程过来的上下文。
    不会 因为TransmittableThreadLocal的传递过程引入内存泄漏的问题。

在其它Issue中 已有讨论,如 是否有内存泄露的风险?#96 @dictionaryshi

可以翻一下相关的 Issue列表(q=内存+label%3Aquestion 😄


更多信息参见:

@oldratlee oldratlee changed the title 关于内存泄漏的问题 上下文传递是否会有内存泄漏 May 23, 2019
@oldratlee oldratlee changed the title 上下文传递是否会有内存泄漏 是否会由上下文传递过程引入内存泄漏 May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate ❓question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants