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
There are a few different type of tuples that trigger this:
(String, Int?)
(String?, Int?)
(String?, Int?, Int)
(String, Int, Int?)
(String, Int?, Int?)
(String, Int?, Int)
(String?, Int, Int)
(String, Int, Int)
The types within the tuple don't seem to matter, only the optionality seems to matter. The issue also occurs whether the tuple itself is optional or not.
There are also a few types that don't trigger this:
(String?, Int)
(String, Int)
Xcode's memory graph debugger shows the issue as coming from:
caseOptional<Any>.none: returntrue
When the `value` is `nil` (e.g. `Wrapper<(String, Int?)>(value: nil)`) it does not cause a memory leak.
Environment
Tested with Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28) using Xcode 12.3 and Xcode 12.4.
iOS 13.0 simulator, iOS 14.4 simulator, iOS 12.4 real device
Additional Detail from JIRA
md5: 08185f64820c0384e60d3647f7180e11
Issue Description:
We've been running in to very high memory usage and I think I've tracked it down. The following code will cause memory usage to continuously grow:
There are a few different type of tuples that trigger this:
(String, Int?)
(String?, Int?)
(String?, Int?, Int)
(String, Int, Int?)
(String, Int?, Int?)
(String, Int?, Int)
(String?, Int, Int)
(String, Int, Int)
The types within the tuple don't seem to matter, only the optionality seems to matter. The issue also occurs whether the tuple itself is optional or not.
There are also a few types that don't trigger this:
(String?, Int)
(String, Int)
Xcode's memory graph debugger shows the issue as coming from:
When the `value` is `nil` (e.g. `Wrapper<(String, Int?)>(value: nil)`) it does not cause a memory leak.
A workaround for this is to use `if case`:
The text was updated successfully, but these errors were encountered: