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
[SR-5472] Swift 4.0 Memory leak on Linuxies using URLSession? #3831
Comments
This appears to be a recent regression (or is due to being a dev build?): johnno@Ubuntu16:~/swift-android-samples/swifthello$ ~/swift-4.0-DEVELOPMENT-SNAPSHOT-2017-07-13-a-ubuntu16.04/usr/bin/swift -O hello.swift |
Seems to be a regression looking back at the 3.1 development snapshot (KB not increasing): johnno@Ubuntu16:~/swift-android-samples/swifthello$ ~/swift-3.1-DEVELOPMENT-SNAPSHOT-2017-06-14-a-ubuntu16.04/usr/bin/swift -O hello.swift |
Graphing memory use, even Swift 3.1 showed continually increasing memory use though increasing at a slower rate. |
@phausler, an autorelease pool thing, maybe? |
My guess is the differential of leaks is more pronounced because the swift implementation of NSURLSession and other Foundation classes are not nearly as optimized as the objective-c versions. That being said; if they are both leaking then we have achieved parity. It would be useful to build this example on Darwin based of swift-corelibs-foundation and run it in instruments. (you can attach Instruments to the TestFoundation target and run this code before the test main). |
It was the much greater leakage with Swift4 toolchains (on Linux) I was trying to point out (see the first comment.) |
PR raised which seems to fix this problem on Linux as well as Android #1195 |
Implement a custom Data.Iterator
Environment
Linux 16.04, Swift built from master 2017-07-16
Additional Detail from JIRA
md5: e055efa0a71c9a5f3c321efec7fe7e4e
Issue Description:
Hi, I’ve been looking at the Linux variant or Swift and found what could be a memory leak when using URLSession. If I place the code below in a file and execute using the REPL, the recorded memory continually increases on Linux by about roughly the amount of the Data received from the website. Memory also increases indefinitely on macOS but the effect is not quite so pronounced. This seems to be a regression relative to Swift 3.1.
The text was updated successfully, but these errors were encountered: