Would this CZML structure leak memory in Chrome?

1. A concise explanation of the problem you're experiencing.

I am working with CZML for the first time, and attempting to animate a series of radar images through a CzmlDataSource object. The animation works fine, but in the latest Chrome there seems to be issues with memory consumption when running the clock at x600 step or higher (memory isn't being released) and an eventual rendering crash/error is observed. Memory consumption is noted on IE Edge and Firefox, but it seems to level off. I was wondering if I'm doing anything wrong with the below CZML structure, or if there's a better approach to what I'm attempting.

My project is actually utilizing the gwt-cs wrapper (https://github.com/iSergio/gwt-cs) maintained by iSergio, and is working pretty well to aid in migrating a legacy app I am working on.

2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.

In my viewer, I'm simply calling (JAVA via gwt-cs):

getViewer().dataSources().add(ds.process("/czml/test.czml"));

And my CZML is:

[
{
    "id" : "document",
    "version" : "1.0",
    "clock": {
        "interval":"2017-09-09T12:00:00Z/2017-09-09T18:00:00Z",
        "currentTime": "2017-09-09T12:00:00Z",
        "multiplier":600,
        "range":"LOOP_STOP",
        "step":"TICK_DEPENDENT"
    }
}, {
    "id" : "radar1",
    "name" : "Houston Radar",
    "position" : {
        "cartographicDegrees" : [-95.07, 29.47, 0.0]
    },
    "ellipse" : {
        "semiMinorAxis" : 300000.0,
        "semiMajorAxis" : 300000.0,
        "height" : 0.0,
        "outline" : true,
            "material" : [ {
                "image" : {
                        "transparent" : true,
                        "image" : [
                                {
                                "interval" : "2017-09-09T17:00:00Z/2017-09-09T18:00:00Z",
                                "uri" : "http://data.horizonwx.com/khgx/Base_Reflectivity/1504654708.png"
                                },
                                {
                                "interval" : "2017-09-09T16:00:00Z/2017-09-09T17:00:00Z",
                                "uri" : "http://data.horizonwx.com/khgx/Base_Reflectivity/1504654703.png"
                                },
                                {
                                "interval" : "2017-09-09T15:00:00Z/2017-09-09T16:00:00Z",
                                "uri" : "http://data.horizonwx.com/khgx/Base_Reflectivity/1504654699.png"
                                },
                                {
                                "interval" : "2017-09-09T14:00:00Z/2017-09-09T15:00:00Z",
                                "uri" : "http://data.horizonwx.com/khgx/Base_Reflectivity/1504654694.png"
                                },
                                {
                                "interval" : "2017-09-09T13:00:00Z/2017-09-09T14:00:00Z",
                                "uri" : "http://data.horizonwx.com/khgx/Base_Reflectivity/1504654690.png"
                                },
                                {
                                "interval" : "2017-09-09T12:00:00Z/2017-09-09T13:00:00Z",
                                "uri" : "http://data.horizonwx.com/khgx/Base_Reflectivity/1504654685.png"
                                }
                                ]
                        }
                }
                ]
        }
}
]

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

My goal is to place multiple ellipses over various locations on the maps, and upon user selection - populate them with ImageMaterial based PNG's that display radar for the area covered. The PNG's are swapped out via a URI change to the ImageMaterial.

4. The Cesium version you're using, your operating system and browser.

OS is Win10 x64 on Chrome Version 60.0.3112.113 (Official Build) (64-bit) on i7 860 w/ 8GB RAM.

I’ve just created a simple Sandcastle example for this issue and can confirm there is some sort of issue specific to Google Chrome - Version 61.0.3163.79 (Official Build) (64-bit), which leads to an eventual crash of the browser due to memory exhaustion. This same code does not produce a crash in IE Edge or Firefox from my testing so far.

https://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=8d5057c17012d79e4585531597e0d453

I’m going to submit a an issue to the Cesium GitHub to those awesome folks can have a look. For completeness sake, here is the JavaScript used to reproduce the condition. Note that the imagery URI’s below reference a server which may or may not be available at times depending on development - and the time / date you are reading this thread.

var czml = [
{
“id” : “document”,
“version” : “1.0”,
“clock”: {
“interval”:“2017-09-11T12:00:00Z/2017-09-11T19:00:00Z”,
“currentTime”: “2017-09-11T12:00:00Z”,
“multiplier”:300,
“range”:“LOOP_STOP”,
“step”:“TICK_DEPENDENT”
}
}, {
“id” : “radar”,
“name” : “Houston Radar”,
“position” : {
“cartographicDegrees” : [-95.07, 29.47, 0.0]
},
“ellipse” : {
“semiMinorAxis” : 300000.0,
“semiMajorAxis” : 300000.0,
“height” : 0.0,
“outline” : true,
“material” : [ {
“image” : {
“transparent” : true,
“image” : [
{
“interval” : “2017-09-11T17:00:00Z/2017-09-11T18:00:00Z”,
“uri” : “http://data.horizonwx.com/khgx/Base_Reflectivity/1504654708.png
},
{
“interval” : “2017-09-11T16:00:00Z/2017-09-11T17:00:00Z”,
“uri” : “http://data.horizonwx.com/khgx/Base_Reflectivity/1504654703.png
},
{
“interval” : “2017-09-11T15:00:00Z/2017-09-11T16:00:00Z”,
“uri” : “http://data.horizonwx.com/khgx/Base_Reflectivity/1504654699.png
},
{
“interval” : “2017-09-11T14:00:00Z/2017-09-11T15:00:00Z”,
“uri” : “http://data.horizonwx.com/khgx/Base_Reflectivity/1504654694.png
},
{
“interval” : “2017-09-11T13:00:00Z/2017-09-11T14:00:00Z”,
“uri” : “http://data.horizonwx.com/khgx/Base_Reflectivity/1504654690.png
},
{
“interval” : “2017-09-11T12:00:00Z/2017-09-11T13:00:00Z”,
“uri” : “http://data.horizonwx.com/khgx/Base_Reflectivity/1504654685.png
}
]
}
}
]
}
}
];

var viewer = new Cesium.Viewer(‘cesiumContainer’);
var dataSourcePromise = Cesium.CzmlDataSource.load(czml);
viewer.dataSources.add(dataSourcePromise);
viewer.zoomTo(dataSourcePromise);

``

Hi Andrew,

Thanks for the example! This does looks like it may be a memory leak related to https://github.com/AnalyticalGraphicsInc/cesium/issues/5462 or https://github.com/AnalyticalGraphicsInc/cesium/issues/4645

Here’s a thread for preloading material images to switch out dynamically, it might hep as a workaround.

Thanks!

Gabby

Hi Gabby:

I’ll continue to study those workarounds. I believe this is Chrome specific for sure, and 5462 seems to elaborate on that and match some of the behavior I’m seeing.

For reference, I’ve opened issue 5825 on the Cesium repository, which may be tied into the other reports you already have.

Thanks!

Thanks again! I’ve cross listed the issues as maybe being related, but ultimately one of our graphics developers will probably take a look.