We've found that Firebase is keep crashing on mobile safari because of out of memory. This repo is a minimal repication for this issue.
- Open https://firebase-memory-issue-2022-04.vercel.app/ using iPhone safari.
- Click one of the buttons to load some documents. Each document contains about 39KB of data.
- You can connect your iPhone to your Mac and see the console log as well as the memory usage.
On my iPhone Xr (with 3GB of memory), this webpage will crash after loading about 750 documents, which is about 30MB of raw data. The browser memory usage is about 1.6GB right before the crashing.
You can also run this repo locally.
- Prepare a firebase project that allow read and write without authentication.
- Clone this repo and run
yarn install
. - Download the service account JSON file and save it to
config/firebase.admin.json
. - Download the web app config JSON file and save it to
config/firebase.client.json
. - Run
yarn setup-data
to insert data into firestore database. - Run
yarn dev
to start the web server.