mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #692] Memory leak in Trust-DNS client when used in Windows #273
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#273
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @oherrala on GitHub (Feb 21, 2019).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/692
Describe the bug
Using Trust-DNS client to do a DNS queries in Windows leaks memory causing long running processes to bloat their heap.
To Reproduce
The following code can be used to cause easily observable memory leak in Windows (Windows 10, 10.0.17134 Build 17134). Running it shows memory usage of 72 MB on my test system. Tested with both
trust-dnsversions0.15.1and0.16.0-alpha.2. Dr. Memory leak detector output below.Replace the IP address with proper DNS server in sample code to get it running.
Expected behavior
Allocated memory should be freed after it's no longer needed.
System:
Version:
Crate:
trust-dnsVersion:
0.15.1and0.16.0-alpha.2Additional context
A full Dr. Memory memory leak output:
@bluejekyll commented on GitHub (Feb 21, 2019):
Do you know if this only occurs on Windows? Or is that the only environment you've validated this on?
Also, could you post your Cargo.lock file?
@oherrala commented on GitHub (Feb 21, 2019):
This occurs on Windows, but not on macOS. Also XCode's Instruments didn't find memory leaks. Running on Linux shows RSS of about 5MB, so doesn't look like leaking.
Cargo.lock
@oherrala commented on GitHub (Feb 25, 2019):
Here's a debug trace of the following code:
@oherrala commented on GitHub (Feb 25, 2019):
I probably was able to isolate this issue into
miocrate and reported it there: https://github.com/carllerche/mio/issues/919.@bluejekyll commented on GitHub (Feb 25, 2019):
Thank you for continuing to track this down!
@oherrala commented on GitHub (Aug 20, 2019):
This might have been fixed in https://github.com/tokio-rs/mio/pull/1034
@bluejekyll commented on GitHub (Aug 20, 2019):
Excellent. I've started the slog of upgrading to the future tokio std::future releases. Not sure if the above change is something we can easily incorporate or not?
@oherrala commented on GitHub (Oct 16, 2020):
Tokio 0.3 has been released (https://tokio.rs/blog/2020-10-tokio-0-3) and it contains mio 0.7 which has fixed the memory leak in Windows.
We are getting closer to be able to hopefully close this!
@djc commented on GitHub (Oct 16, 2020):
If there is no other work to be done in trust-dns, how about we close this as a duplicate of #1250 then?
@oherrala commented on GitHub (Jan 7, 2021):
I think this is now fixed in latest trust-dns release (0.20, PRs #1330, #1262).
Thanks everyone involved. Good job!
Closing this now.
LookupIpStrategy::Ipv4AndIpv6orLookupIpStrategy::Ipv6thenIpv4#650