Hi everyone, i'm new in Cesium and we are trying to migrate our GE based website to Cesium due to NPAPI problem. We have a lot of kmz/kml files with a size about of 5-6 MB and we need load it into Cesium but we are having problems when we try load them and i don't know what could be happening, first the screen is freezing and then (seconds ..) i can move the globe but it hasn't loaded anything.
In most of the samples is loading kmz files about size 1 MB and it works fine although there are a few lags problems but it doesn't matter because our main goal is to get load these "big" kmz files and we need some help, if someone can help us, we'd be thankful.
Yes, i've seen this demo and it works fine because they are small KMZ files,
however, if you test "big" KMZ files about 5MB you will see that Cesium fails loading. I test it by drag and drop in Cesium Viewer and code it like samples:
var viewer = new Cesium.Viewer('cesiumContainer');
viewer.dataSources.add(Cesium.KmlDataSource
.load('Tunel2MB.kmz')
)
.then(function (dataSource) {
viewer.flyTo(dataSource.entities);
});
Performance of large KML files is often times enhanced by the use of Regions. Cesium’s KmlDataSource does not currently support Regions, though it is on the roadmap. Do your big files use regions?
You are most likely running into memory limitations built into the browser. Even though you may only have a few megs of KMZ data, that can decompress into much much more and Cesium also has lots of room for improvement when dealing with large amounts of entities (> 20000). While Google Earth can get away with brute forcing loading lots of data, browser based apps have to be a lot smarter about doing things (this is the problem 3D Tiles is eventually going to fix).
That being said, you can try temporarily increasing the amount of memory usable by Chrome to see if it helps you or not. First, be sure you are using the 64bit version of Chrome. 32bit apps only address up to 4GB of RAM (and depending on OS it can be lower). Chrome has artificial per-tab memory limits for the JavaScript engine of around 1GB on 32 bit and 2GB on 64 bit. As you can see, just running 64 bit will get you more memory.
Assuming that’s still not enough, you can change the artificial limit by passing the --max-old-space-size to V8. This specifies the limit in megabytes. For example, if you want to raise the limit to 16GB you would run
chrome.exe --js-flags="–max-old-space-size=16384"
Don’t set the value to higher than the amount of RAM on your machine. You also have to make sure chrome is not running in any capacity when you launch or else the command won’t take. You can confirm this by checking the special chrome://version page, which lists command line arguments.
While this isn’t an ideal solution overall, it might confirm that memory is the issue. If you can share one of the problematic KMZ files, we’d be happy to use it for performance testing when we try to optimize these cases in the future.
I've tested you told me and nothing has improve, I installed 64 bits chrome version and ran it with the command: chrome.exe --js-flags="--max-old-space-size=2048" (i have only 4 GB of RAM) and the performance is the same, it fails.
Michael, sorry for taking so long to get back to you. I just posted a full explanation and reply in this thread: https://groups.google.com/d/msg/cesium-dev/Pv7ElUvjkTc/U5wQ6-zKDQAJ (it sometimes takes a minute for replies to show up once sent via email, but if it’s not there in a little while, let me know). Thanks.