| | | |------------------|-----------------| |Previous ID | SR-6881 | |Radar | https://bugreport.apple.com/web/?problemID=37082760 | |Original Reporter | Jay18001 (JIRA User) | |Type | Bug | Attachment: [Download](https://user-images.githubusercontent.com/2727770/164962549-94596408-7d30-4738-9ab2-31c6c78ce2ba.gz) <details> <summary>Environment</summary> iOS 11.2, simulator and iPhone X Xcode 9.2 (9C40b) macOS 10.12.6 (16G1114) </details> <details> <summary>Additional Detail from JIRA</summary> | | | |------------------|-----------------| |Votes | 0 | |Component/s | Foundation | |Labels | Bug, Leak | |Assignee | None | |Priority | Medium | md5: 2870ec4b8f985c3e6bf0c0086b771c40 </details> **Issue Description:** When a 10mb file is downloaded using URLSession and written to disk and saved to NSCache the memory goes up by 20mb. Using the following causes the leak: ``` none do { try data.write(to: fileUrl) } catch { print(error) } ``` However doing this does not cause the leak: ``` none (data as NSData).write(to: fileUrl, atomically: true) ``` It happens every time the button is pressed in the attached example project
Activity
belkadan commentedon Feb 1, 2018
@swift-ci create