Our React app crashes on iOS due to memory pressure when loading workflows. The crash occurs either during the initial load or shortly after the workflow has finished loading. We have already made previous memory optimizations, but the crashes are still frequent enough to be a real user problem.
The app is a web application primarily designed for desktop use. The workflow feature in particular was built with desktop memory budgets in mind, which likely contributes to the higher memory footprint on iOS.
What we have tried
-
Memoizing components and selectors with
useMemo, anduseCallbackto avoid unnecessary re-renders and object allocation. -
Lazy loading the workflow itself so it is not parsed or mounted until needed.
-
Pausing background data fetching when opening the workflow, to avoid competing memory pressure during load.
-
Various additional optimizations across earlier iterations that reduced peak usage, but not enough to prevent crashes reliably.
Environment