Skip to content

Fix memory spikes caused by Metal texture capturing#2882

Merged
Andrei Salavei (ASalavei) merged 4 commits into
jb-mainfrom
andrei.salavei/fix-memory-spikes
Mar 17, 2026
Merged

Fix memory spikes caused by Metal texture capturing#2882
Andrei Salavei (ASalavei) merged 4 commits into
jb-mainfrom
andrei.salavei/fix-memory-spikes

Conversation

@ASalavei

@ASalavei Andrei Salavei (ASalavei) commented Mar 17, 2026

Copy link
Copy Markdown

Dispose resources captured by the unused CMPDrawable.
Prevent GCD from capturing metal texture.

Fixes https://youtrack.jetbrains.com/issue/CMP-9939/Compose-Multiplatform-sheet-resizing-causes-excessive-IOSurface-memory-growth-on-iOS
Fixes: https://youtrack.jetbrains.com/issue/CMP-9918/Clear-metal-buffers-when-ComposeUIViewController-goes-out-of-window

Tests

Since the issue reproduces only on the real device there is no way to write proper tests now.

Release Notes

Fixes - iOS

  • (prerelease fix) Fix high memory consumption caused by the Compose container resizing when parallelRendering is enabled

@ASalavei Andrei Salavei (ASalavei) merged commit c144a7d into jb-main Mar 17, 2026
22 checks passed
@ASalavei Andrei Salavei (ASalavei) deleted the andrei.salavei/fix-memory-spikes branch March 17, 2026 15:54
ApoloApps pushed a commit to ApoloApps/compose-multiplatform-core that referenced this pull request Mar 17, 2026
Dispose resources captured by the unused CMPDrawable.
Prevent GCD from capturing metal texture.

Fixes
https://youtrack.jetbrains.com/issue/CMP-9939/Compose-Multiplatform-sheet-resizing-causes-excessive-IOSurface-memory-growth-on-iOS
Fixes:
https://youtrack.jetbrains.com/issue/CMP-9918/Clear-metal-buffers-when-ComposeUIViewController-goes-out-of-window

### Tests
Since the issue reproduces only on the real device there is no way to
write proper tests now.

## Release Notes
### Fixes - iOS
- _(prerelease fix)_ Fix high memory consumption caused by the Compose
container resizing when `parallelRendering` is enabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants