Remove all textured models from the scene.primitives, but the CPU memory occupancy is still high.

Hi everyone,

I uesd the Model.fromGltf to load 200+ individual textured 3D building models, then add them to scene.primitives to render in Cesium. When the render finished,I uesd the scene.primitives.removeAll() function, the models were all removed and destroyed, but the CPU memory occupancy is still high.

1. Just render the Cesium globel without any primitive or entity, the original CPU memory occupancy is about 3.5GB.

2. When finished rendering the 200+ individual textured models, the CPU memory occupancy is about 8.6GB.

3. When removed all the 200+ individual textured models, the final CPU memory occupancy is about 4.2GB.

4. The 200+ individual textured models have 4600+ files(.gltf, .glsl, .bin and .jpg).The .gltf files are about 9 MB, .glsl files are about 300 KB ,.bin files are about 6 MB and the .jpg files are about 80 MB.

**********************Test Environment******************************
Platform:Desktop Computer
OS:Windows7 Ultimate(64 bit)
CPU: Inter(R) Core(TM) i5-4570 CPU @ 3.20GHz 3.20 GHz
Graphics Card:NVIDIA GeForce GTX750
RAM: 16G

Cesium Version : 1.21

First I would suggest trying the latest version of Cesium.

Then is there any difference in behavior when you construct the Model with

releaseGltfJson : true

``

This is an undocumented options. It releases the gltf immediately after the Model is constructed, which is fine to do when all models are unique and there is no benefit to caching. I don’t really expect this to fix the problem though, but am just curious.

If you’re still seeing issues I can open a github issue since this seems to be a pretty big memory leak.

在 2016年11月7日星期一 UTC+8下午10:52:37,Sean Lilley写道:

First I would suggest trying the latest version of Cesium.

Then is there any difference in behavior when you construct the Model with

releaseGltfJson : true

This is an undocumented options. It releases the gltf immediately after the Model is constructed, which is fine to do when all models are unique and there is no benefit to caching. I don't really expect this to fix the problem though, but am just curious.

If you're still seeing issues I can open a github issue since this seems to be a pretty big memory leak.

On Sunday, November 6, 2016 at 12:54:23 AM UTC-4, linl...@gmail.com wrote:Cesium Version : 1.21

Hi Sean,

I'm sorry to reply you so late, there was something wrong with my email so I did not receive your message early. Thank you so much to reply me immediately.

I have read some source code about the primitiveCollection and primitive, I found the undocumented option("releaseGltfJson : true") and tried it. But it seems to do nothing with this memory leak issue.
I will pay close attention to this issue.If you find some solutions to fix it,please inform me.

Thanks.
Ganey

Ok I didn’t expect too much from that command. And just to be sure, have you tried running in Cesium 1.27 yet?

在 2016年11月14日星期一 UTC+8下午11:05:14,Sean Lilley写道:

Ok I didn't expect too much from that command. And just to be sure, have you tried running in Cesium 1.27 yet?

On Sunday, November 13, 2016 at 9:54:09 PM UTC-5, linl...@gmail.com wrote:在 2016年11月7日星期一 UTC+8下午10:52:37,Sean Lilley写道:

> First I would suggest trying the latest version of Cesium.

>

>

> Then is there any difference in behavior when you construct the Model with

>

>

>

> releaseGltfJson : true

>

> This is an undocumented options. It releases the gltf immediately after the Model is constructed, which is fine to do when all models are unique and there is no benefit to caching. I don't really expect this to fix the problem though, but am just curious.

>

>

> If you're still seeing issues I can open a github issue since this seems to be a pretty big memory leak.

>

>

> On Sunday, November 6, 2016 at 12:54:23 AM UTC-4, linl...@gmail.com wrote:Cesium Version : 1.21

Hi Sean,

I'm sorry to reply you so late, there was something wrong with my email so I did not receive your message early. Thank you so much to reply me immediately.

I have read some source code about the primitiveCollection and primitive, I found the undocumented option("releaseGltfJson : true") and tried it. But it seems to do nothing with this memory leak issue.

I will pay close attention to this issue.If you find some solutions to fix it,please inform me.

Thanks.

Ganey

Yes,I have tried running the test in Cesium 1.27, but it also has memory leak problem. I removed some building models and added another building models and then removed them, the CPU memory occupancy got higher and higher.

Ok I will open a github issue soon and look into this.

I opened an issue on github: https://github.com/AnalyticalGraphicsInc/cesium/issues/4645 that I will investigate soon.

在 2016年11月15日星期二 UTC+8下午11:09:15,Sean Lilley写道:

I opened an issue on github: Memory leak when removing textured models · Issue #4645 · CesiumGS/cesium · GitHub that I will investigate soon.

Ok I will open a github issue soon and look into this.

On Monday, November 14, 2016 at 7:41:30 PM UTC-5, linl...@gmail.com wrote:在 2016年11月14日星期一 UTC+8下午11:05:14,Sean Lilley写道:

> Ok I didn't expect too much from that command. And just to be sure, have you tried running in Cesium 1.27 yet?

>

> On Sunday, November 13, 2016 at 9:54:09 PM UTC-5, linl...@gmail.com wrote:在 2016年11月7日星期一 UTC+8下午10:52:37,Sean Lilley写道:

>

> > First I would suggest trying the latest version of Cesium.

>

> >

>

> >

>

> > Then is there any difference in behavior when you construct the Model with

>

> >

>

> >

>

> >

>

> > releaseGltfJson : true

>

> >

>

> > This is an undocumented options. It releases the gltf immediately after the Model is constructed, which is fine to do when all models are unique and there is no benefit to caching. I don't really expect this to fix the problem though, but am just curious.

>

> >

>

> >

>

> > If you're still seeing issues I can open a github issue since this seems to be a pretty big memory leak.

>

> >

>

> >

>

> > On Sunday, November 6, 2016 at 12:54:23 AM UTC-4, linl...@gmail.com wrote:Cesium Version : 1.21

>

>

>

>

>

> Hi Sean,

>

>

>

> I'm sorry to reply you so late, there was something wrong with my email so I did not receive your message early. Thank you so much to reply me immediately.

>

>

>

> I have read some source code about the primitiveCollection and primitive, I found the undocumented option("releaseGltfJson : true") and tried it. But it seems to do nothing with this memory leak issue.

>

> I will pay close attention to this issue.If you find some solutions to fix it,please inform me.

>

>

>

> Thanks.

>

> Ganey

Yes,I have tried running the test in Cesium 1.27, but it also has memory leak problem. I removed some building models and added another building models and then removed them, the CPU memory occupancy got higher and higher.

Got it,I will pay close attention to it. Thanks!