Pool and reuse OwnedLayer objects when possible based on the recycle api in OwnedLayerManager - #3409
Open
Apolo (ApoloApps) wants to merge 5 commits into
Open
Apolo (ApoloApps) wants to merge 5 commits into
Apolo (ApoloApps) wants to merge 5 commits into
Conversation
…api in OwnedLayerManager. This aligns nonAndroid source sets with the Android behaviour
Vladimir Mazunin (mazunin-v-jb)
requested review from
Ivan Matkov (MatkovIvan) and
Alexander Maryanovsky (m-sasha)
September 14, 2026 10:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pools an reuses Ownedlayer objects in RootNodeOwner aligning with Android. WeakCache is copied from Android for Jvm and similar but customized for all other nonJvm. The recycle API in OwnedLayerManager was not being used, and new OwnedLayer objects were being created every time when they can be reused. Tested with logging in the web demo and it seems to create new layers at first but then starts reusing pooled ones when enough in the cache
Fixes https://youtrack.jetbrains.com/issue/CMP-10777/Pool-and-reuse-OwnedLayer-objects-when-possible-based-on-the-recycle-api-in-OwnedLayerManager
Release Notes
N/A