Memory Leak on iOS

The code below is almost a minimal case (yay!) that exhibits the issue. It display 3 images from a “circular buffer”. Tapping any picture remove the first image and adds a new one at the end of the array.

The problem is does never release the memory used by the panel (or images). Worse, it keeps allocating memory. (Again, this is a minimal case, the memory increase is about 150KiB per tap, but in the real app it is +1MB per page)

Also, the CPU usage is pretty high. On an iPhone 6+, the CPU usage is about 10% when idle.

<App Theme="Basic">
        var Observable = require("FuseJS/Observable");

        var URL = ";;

        var allItems = Observable();
        var visibleItems = Observable();

        function log(what) {

        function downloadFeed() {

            fetch(URL, {
                method: "GET",
                headers: {"Content-type": "application/json"}
            }).then(function(response) {
                return response.text();
            }).then(function(fakeJSON) {
                log("Removing weird function enclosure...");
                var r = /jsonFlickrFeed(({[^]*}))/m;
                var match = r.exec(fakeJSON);
                var json = JSON.parse(match[1]).items;

                log("Adding items...");


        var index = 0;
        var numberOfVisibleItems = 3;

        function removeItem() {

        function fillVisibleItems() {
            while (visibleItems.length < numberOfVisibleItems) {
                if (index >= allItems.length) {
                    index = 0;

                index += 1;

        module.exports = {
            items: visibleItems,
            RemoveItem: removeItem,


            <StackPanel Clicked="{RemoveItem}">
                <Each Items="{items}">
                    <Image Url="{media.m}" Margin="0" StretchMode="Uniform" />

Woah! Thanks for the test case.

We will be investigating this immediately.

I’m sorry for the late reply, but I cannot reproduce this issue any more. The lifetime of JavaScriptCore objects has been entirely rewritten since this issue was reported, so I assume it’s no longer the case. Please let me know if I somehow misdiagnosed, and you still suffer from this.