Repository navigation
test(rn-tester): Playground reproducer for unmounted ShadowNodeWrapper retention (#60210) - #60215
Open
john-stalvern wants to merge 1 commit into
Open
john-stalvern wants to merge 1 commit into
john-stalvern wants to merge 1 commit into
Conversation
This was referenced Nov 22, 2026
This branch has not been deployed
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.
Summary
Adds a self-contained reproducer to
packages/rn-tester/js/examples/Playground/RNTesterPlayground.jsfor react-native#60210: host components that have been unmounted keep theirShadowNodeWrapperentries alive, so native memory grows on every navigation/mount-unmount cycle and never returns to its previous floor.The Playground now renders a "Run 20 mount/unmount cycles" button. Pressing it repeatedly mounts and unmounts a nontrivial tree built only from stock primitives — nested
Views,Text, and a localImage— with a newgenerationkeyon every mount so fresh host nodes are created each cycle. No third-party dependencies, so this runs on a stock RNTester build. A "GC" button callsglobal.gc()(Hermes dev builds), matching DevTools' "Collect garbage", so the same loop can be measured with and without a manual collection.Motivation
Issue #60210 currently carries the react-native-bot
Missing reproducerwarning; issues without a valid reproducer are auto-staled. This Playground change is the reproducer — it exercises the same push/pop-style unmount path that retains ~1.0–1.5 MB of native heap per cycle on 0.83.6 with the New Architecture and Bridgeless enabled.Test plan
Build RNTester with the New Architecture enabled and open Playground:
In the Playground, tap Run 20 mount/unmount cycles and sample native heap before and after:
Repeat with GC tapped before each sample. Expected on the affected version:
Native Heaprises monotonically across the 20 cycles and, after a GC, does not fall back to the pre-loop baseline — the "sawtooth that never descends" signature. On a fixed build the post-GC heap should return to approximately the starting value.To observe the retention directly, use the React Native DevTools heap profiler and search for
ShadowNodeWrapperinstances after the loop completes.No production code is changed; this is an rn-tester-only reproducer. Changelog: [Internal]