The Wire · Showcase
React plugs memory leaks in Flight and Fizz
By RepoJournal · Filed · About Meta
React's server rendering stack just got a memory fix that matters for long-lived signals.
React's server renderer was leaking entire rendered outputs in memory for as long as a caller's AbortSignal lived. Two patches from unstubbable fix this: one stops the caller's signal from retaining a finished render [1], the other aborts the cache signal when debug objects are retained [2]. For Flight, debug objects that exceed the model's object limit stay retained until the client asks for them, which kept renders alive longer than needed. Composite signals from AbortSignal.any() and timeout signals are the worst offenders, because the runtime holds onto them for the lifetime of the process. These fixes close that leak on the success path, where the abort listener previously stayed attached. Over in React Native, a routine Flow upgrade in fbsource [3] landed, nothing to rush for. This is the kind of cleanup you want in before your next server render spike.
One email a day. Unsubscribe in one click.
Keep up with Meta in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Review the two React server rendering patches and pull them into your next release facebook/react [plan]
- → Audit long-lived AbortSignals in your Flight and Fizz integrations facebook/react [immediate]
- → Confirm the Flow upgrade in React Native does not affect your toolchain facebook/react-native [monitor]
References
- [1] [Flight/Fizz] Stop the caller's signal from retaining a finished render ↗ facebook/react
- [2] [Flight] Abort the cache signal when debug objects are retained ↗ facebook/react
- [3] Upgrade Flow in fbsource (#58076) facebook/react-native