<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-memory-hermes-can-t-see-stale-shadow-nodes-in-rn-mgjv6pri7" -->

---
title: The Memory Hermes Can't See: Stale Shadow Nodes in RN
description: An investigation into why stale Shadow Nodes accumulate in React Native's Fabric architecture, causing memory to grow outside the JS heap where Hermes GC...
canonical: https://daily.dev/posts/the-memory-hermes-can-t-see-stale-shadow-nodes-in-rn-mgjv6pri7
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The Memory Hermes Can't See: Stale Shadow Nodes in RN | daily.dev
og:description: An investigation into why stale Shadow Nodes accumulate in React Native's Fabric architecture, causing memory to grow outside the JS heap where Hermes GC...
og:url: https://daily.dev/posts/the-memory-hermes-can-t-see-stale-shadow-nodes-in-rn-mgjv6pri7
og:image: https://api.daily.dev/og/posts/MGJV6PRi7.png
og:image:alt: The Memory Hermes Can't See: Stale Shadow Nodes in RN
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The Memory Hermes Can't See: Stale Shadow Nodes in RN

**[Software Mansion](https://daily.dev/sources/swmansion)** · 5 min read · 0 upvotes · 0 comments

## Summary

An investigation into why stale Shadow Nodes accumulate in React Native's Fabric architecture, causing memory to grow outside the JS heap where Hermes GC cannot see it. Shadow Node Wrappers — JS objects holding shared_ptr references to Shadow Nodes via jsi::NativeState — keep old tree revisions alive after views are unmounted. Because the retained memory sits outside the JS heap, Hermes GC has no visibility into it and doesn't collect it promptly. Two partial fixes were tested: forced periodic GC calls and setting memory pressure via setExternalMemoryPressure, but both have significant drawbacks. The root cause remains unresolved, and smaller apps with less JS garbage may be disproportionately affected.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://swmansion.com/blog/the-memory-hermes-cant-see-stale-shadow-nodes-in-react-native>

## Questions this post answers

### Why does memory keep growing in my React Native app that uses Reanimated with the New Architecture even though views are unmounted?

Shadow Node Wrappers, JS objects that hold a shared_ptr to a Fabric Shadow Node via jsi::NativeState, keep pointing to stale Shadow Tree revisions after a view unmounts. Since that retained memory lives outside the JS heap, the Hermes garbage collector has no visibility into it and only frees it when it eventually collects the wrapper and its component, causing memory to accumulate between GC runs.

_daily.dev surfaces deep dives like this for teams debugging native memory retention in React Native's New Architecture._

### Does Hermes's setExternalMemoryPressure API fix native memory retained by JSI objects in React Native?

Only partially, and it does not reliably fix the Shadow Node Wrapper issue. setExternalMemoryPressure on jsi::Object lets code tell the GC that extra native memory is attached to an object, but Reanimated re-points the Wrapper's underlying shared_ptr entirely in C++ on every animation frame, so any pressure value set becomes stale immediately after; hardcoding 2 KB per wrapper caused excessive GC firing and CPU overhead instead.

_track findings like this on daily.dev before tuning GC memory pressure hints in your own React Native app._

## Similar posts on daily.dev

- [Find & Fix Node.js Memory Leaks with Heap Snapshots](https://daily.dev/posts/find-fix-node-js-memory-leaks-with-heap-snapshots-89dj8jypm) · Halodoc · 18 upvotes · 0 comments
- [The Secret Life of JavaScript: The Garbage Collector](https://daily.dev/posts/the-secret-life-of-javascript-the-garbage-collector-r96mslcqu) · DEV · 8 upvotes · 1 comments
- [Hermes, React Navigation, CSS Grid, Maestro, QuickPush, Screens, Expo Skills, Async Storage](https://daily.dev/posts/hermes-react-navigation-css-grid-maestro-quickpush-screens-expo-skills-async-storage-7oospwkde) · This Week In React · 4 upvotes · 0 comments

---

Tags: [#react-native](https://daily.dev/tags/react-native)

[View this post on daily.dev](https://daily.dev/posts/the-memory-hermes-can-t-see-stale-shadow-nodes-in-rn-mgjv6pri7)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The Memory Hermes Can't See: Stale Shadow Nodes in RN","url":"https://daily.dev/posts/the-memory-hermes-can-t-see-stale-shadow-nodes-in-rn-mgjv6pri7","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-memory-hermes-can-t-see-stale-shadow-nodes-in-rn-mgjv6pri7"},"datePublished":"2026-08-05T15:06:33.827Z","dateModified":"2026-09-14T08:19:22.853Z","description":"An investigation into why stale Shadow Nodes accumulate in React Native's Fabric architecture, causing memory to grow outside the JS heap where Hermes GC...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/4cad6fba45f14952d261987a60331fe1?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/4cad6fba45f14952d261987a60331fe1?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Software Mansion","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Software Mansion","logo":"https://media.daily.dev/image/upload/s--sOx0vaVZ--/f_auto,q_auto/v1785654908/logos/swmansion?_a=BAMAMicg0","url":"https://daily.dev/sources/swmansion"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/the-memory-hermes-can-t-see-stale-shadow-nodes-in-rn-mgjv6pri7","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"react-native","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Software Mansion","item":"https://daily.dev/sources/swmansion"},{"@type":"ListItem","position":3,"name":"The Memory Hermes Can't See: Stale Shadow Nodes in RN"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/the-memory-hermes-can-t-see-stale-shadow-nodes-in-rn-mgjv6pri7#faq","mainEntity":[{"@type":"Question","name":"Why does memory keep growing in my React Native app that uses Reanimated with the New Architecture even though views are unmounted?","acceptedAnswer":{"@type":"Answer","text":"Shadow Node Wrappers, JS objects that hold a shared_ptr to a Fabric Shadow Node via jsi::NativeState, keep pointing to stale Shadow Tree revisions after a view unmounts. Since that retained memory lives outside the JS heap, the Hermes garbage collector has no visibility into it and only frees it when it eventually collects the wrapper and its component, causing memory to accumulate between GC runs. daily.dev surfaces deep dives like this for teams debugging native memory retention in React Native's New Architecture."}},{"@type":"Question","name":"Does Hermes's setExternalMemoryPressure API fix native memory retained by JSI objects in React Native?","acceptedAnswer":{"@type":"Answer","text":"Only partially, and it does not reliably fix the Shadow Node Wrapper issue. setExternalMemoryPressure on jsi::Object lets code tell the GC that extra native memory is attached to an object, but Reanimated re-points the Wrapper's underlying shared_ptr entirely in C++ on every animation frame, so any pressure value set becomes stale immediately after; hardcoding 2 KB per wrapper caused excessive GC firing and CPU overhead instead. track findings like this on daily.dev before tuning GC memory pressure hints in your own React Native app."}}]}
```

