-
Notifications
You must be signed in to change notification settings - Fork 146
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
Memory leak on windows #83
Comments
代码上怎么写的呢?直接用的 example 吗 |
@e1732a364fed run the example first, it can read/write to the tun interface, anything other than that should be your own job. |
我是在问,你这个 memory leak 的issue 是由什么代码造成的。你没理解我的意思。比如说,example 的代码是不是就会有你这个 issue 的问题 |
为什么理解中文如此难呢?你的截图中有中文 |
不是example代码,按照自己的需要加的,我看能不能提供一个能重现问题的mini-example |
内存泄露,有定位到具体原因吗 |
一直没有处理,我这里不会崩溃,只是内存泄漏。 |
我也感觉这个地方有问题,一直会启动线程。 |
Got the time to look into this lately, the problem is that The fix is simple, check if the polling thread is running before creating. The most important thing is that loop {
// in this case, Queue::poll_read will fire once no more than 10ms, even if no data is available.
tokio::select!{
_ = sleep_10ms() => {},
msg = dev.next() => {},
}
} |
Hi, I suggest you try the new version of the |
I'm using the latest version
0.6.1
(asyn api) on Windows, quickly after I finished my code and tested it on Windows 11, I noticed that the memory consumption continued to increase(over 1MB increase in 1 second) and never got freed, so I used Visual Studio to detach to the process and take several memory snapshots to take a close look into this, please check the attached images, from my prospect of view, it's likely coming fromwintun
crate or evenwindows
crate, can anybody look into this?The text was updated successfully, but these errors were encountered: