Long-living effect memory issue when using concurrency #1337
-
Hi, I'm trying to use the TCA (which is awesome BTW) to implement some long-living effect to change state with high-frequency actions, but here is some memory issue i guess. I'm using the AVFoundation to get CVPixelBuffer and send an action to update state, in order to produce the issue here, for example, if I change the long-living example here to the following, // Simulate high-frequency action
for await _ in await DispatchQueue.main.timer(interval: 0.01) {
await send(.userDidTakeScreenshotNotification)
} the memory will keeps increasing. I can confirm that the According to the doc, I understand that the TCA is not designed or not recommended for high-frequency actions, but what I facing seems a bug to me, and couldn't find any doc or issue about this one. Am I doing something wrong? Can someone help me with this? Tested on Xcode 14.0 beta 6, iPhone 13 Pro Max (Simulator), main branch. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Good catch! There was definitely a leak here. Tasks are so small that it takes some time and speed for the leak to build up, but it's definitely there. I've pushed #1338 to address. |
Beta Was this translation helpful? Give feedback.
Good catch! There was definitely a leak here. Tasks are so small that it takes some time and speed for the leak to build up, but it's definitely there. I've pushed #1338 to address.