iOS $http json Memory Leak


#1

Hi everyone,

I have an issue with the $http service, not only related to ionic.
Everytime I make an Ajax call to a server to retrieve some JSON data. The memory on iOS increase (you can see it with Xcode). At some point, the memory is too high and the app just crash.
Is there a way to avoid this? Without using a cache system?

You can easily reproduce this. Init a new ionic project and make a $http.get() call. (At this uri for example http://fr.openfoodfacts.org/api/v0/produit/3029330003533.json ).

This behavior occur without ionic, it’s an angular issue, but I ask here if someone have a solution.
I haven’t try to reproduce it on a android device yet

Thanks
Lucas


#2

Having this issue as well.


#3

Don’t have a solution for your problem, but it is an interesting question. I found this article it might help: http://www.codeproject.com/Articles/882966/Fixing-Memory-Leaks-in-AngularJS-and-other-JavaScr


#4

Very interesting article.

I found this one : http://josh.zeigler.us/technology/web-development/how-big-is-too-big-for-json/
Maybe big json cause a too important increase of the memory, so it’s disturb the life cycle of the framework and it can’t use the garbage collector properly… I don’t know, it’s weird.


#5

I’m facing exactly the same problem. Did you find any solutions or a work around to this problem?