Memory leak in network stack

I have written an application that is dealing with 50-100 network requests per second and the memory is constantly growing (reaching 1gb per day). The first version was in Swift, so I believed it was a Swift related issue and reported it here https://bugs.swift.org/browse/SR-14194. Then I decided to rewrite my application in Rust and surprisingly had the same memory issue. Same code runs fine on Linux. There seems to be a memory leak down the network request stack.

Example in Rust: https://gist.github.com/telcy/b1c3a444def65dd0f1d109b6a98db0f1 Example in Swift: https://bugs.swift.org/browse/SR-14194

I have reported the issue (FB9076036 & FB9725494) half a year ago and I am still waiting for a fix.

Does anyone have the same issue?

As far as we can tell this leak is coming from our TLS implementation, which is why it happens regardless of what language or API you use. However, it’s hard to confirm this without more time to test, and I just don’t have that time to spend here on DevForums. My advice is that you open a DTS tech support incident so that Matt or I can look into this in depth.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Memory leak in network stack
 
 
Q