Skip to content Skip to sidebar Skip to footer

Do Adding Value/Child Events To A Around 15 Firebase Objects Cause Heap Size Increments?

I am working on an application and I need to load all the user data when he logs in. So i am listening to multiple firebase references with the value and child event listeners and

Solution 1:

The listeners themselves are relatively cheap to add and should not cause significant heap growth. However, the data that is pulled down to the device as a result of adding the listener can be large and trigger heap growth warnings.

The Firebase SDK will use memory proportional to the amount of data returned by your listeners. So, if your listener is pulling down a large object, it will use more memory. Small objects will use less.

One thing to try is to fetch the same data via curl (try .toString() on the Firebase ref to get the URL) and see how much data is returned. If it is significantly more than you were expecting, you may need to tailor your data layout or the queries you are using.


Post a Comment for "Do Adding Value/Child Events To A Around 15 Firebase Objects Cause Heap Size Increments?"