You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run this code in either Swift 2.1 or 2.2 and watch the activity monitor. Memory usage keeps increasing.
If instead of {"adsdasf".dataUsingEncoding(NSUTF8StringEncoding)} one simply does {NSData()} all seems fine.
So this suggests to me that some memory leak is happening in the dataUsingEncoding(_) function.
I'm not entirely sure if this is Swift related (i.e. goed wrong somewhere in the Objective-C <-> Swift bridging) or if it is purely in Foundation, but I thought to start somewhere 🙂.
If it is Foundation related I should probably file a radar?
The text was updated successfully, but these errors were encountered:
Ah yes, doing manual memory management in ObjC has been a long time ago, so I completely forgot I had to use autoreleasepools and do this manually when creating console applications.
Will try tonight (CET) if this works and report back.
Additional Detail from JIRA
md5: f97dfbe68c09ac47b338328c0eb2f062
Issue Description:
It seems NSData.dataUsingEncoding(_) has a memory leak.
See the following code:
Run this code in either Swift 2.1 or 2.2 and watch the activity monitor. Memory usage keeps increasing.
If instead of {"adsdasf".dataUsingEncoding(NSUTF8StringEncoding)} one simply does {NSData()} all seems fine.
So this suggests to me that some memory leak is happening in the dataUsingEncoding(_) function.
I'm not entirely sure if this is Swift related (i.e. goed wrong somewhere in the Objective-C <-> Swift bridging) or if it is purely in Foundation, but I thought to start somewhere 🙂.
If it is Foundation related I should probably file a radar?
The text was updated successfully, but these errors were encountered: