angularfire2-offline icon indicating copy to clipboard operation
angularfire2-offline copied to clipboard

Memory leak

Open peter-o opened this issue 7 years ago • 6 comments

I'm currently implementing Ionic2 app with this wrapper and it seems to cause issues with memory usage (fully explained here: https://stackoverflow.com/questions/46086610/ionic2-angularfire2-offline-memory-leak) It looks like every update of the object on the list increases the memory usage by over 1MB which leads to memory leak and app crash on android device. I'm updating each item using following code: this.db.object("/path/to/list/objectKey").update(newData); At the same time, I have a list (AfoListObservable) displayed on the screen with async pipe so I'm not sure if the issue is caused by the update itself or because the list is refreshed. The list is created like this: var list = this.db.list("/path/to/list") The list is not huge (~40 objects when I tested it) but the app can easily use over 100MB after just a few minutes of using it (strting from ~35MB). Has anyone experienced similar issues before?

peter-o avatar Sep 07 '17 09:09 peter-o

The async pipe has had memory leaks in the past, I'd try and rule that out as well.

larssn avatar Sep 26 '17 15:09 larssn

The problem is that it works fine when I don't use the offline wrapper.

peter-o avatar Sep 26 '17 15:09 peter-o

So simply using angularfire2 and there's no memory problems?

larssn avatar Sep 26 '17 15:09 larssn

Yes.

peter-o avatar Sep 26 '17 15:09 peter-o

@peter-o without the offline wrapper means..? Please explain I'm facing same issue!

AnkitMaheshwariIn avatar Sep 29 '17 09:09 AnkitMaheshwariIn

There is not much to explain - I haven't resolved that issue yet. Basically, everything works fine until I add angularfire2-offline so it just confirms that the memory leak is not caused by any other component in my project. Let me know if you find the solution - I'll have to get back to it pretty soon, so any tips are very welcome.

peter-o avatar Sep 29 '17 09:09 peter-o