I’ve got an ionic list that can grow pretty long and includes an image on each list item. This can become a bit of a memory problem, even though I’m using infinite scroll to implement a degree of lazy loading. If the user scrolls far enough, they will crash.
I’m working on a way to recycle memory from the images by removing them when scrolled out, adding them back when scrolled in. Most of that isn’t all that difficult to do, but the problem is I’m not seeing memory actually get freed.
I’ve tried remove(), removeChild(), replaceChild(), as well as setting src to a tiny image and a few other common tricks. So far, the memory appears to be hanging around no matter what I do.
Any suggestions? What might be keeping the images hanging around in memory? The images themselves don’t appear to have any event bindings, and at any rate swapping out the src should be unloading the original image, I’m just not seeing memory use go down.