I’m doing a lot of mesh combining and every time I create a new mesh it gets added to the total memory usage and the old mesh doesn’t get removed from memory. This may not really be a problem as I haven’t run it up to crashing yet. The garbage collector may kick in at some time and clean it up, although I haven’t seen this happen yet. That may be because I haven’t gone over some unknown memory percentage.
So when I say its solved I may only be solving an imaginary problem
“Problem” code:
excerpt from the CombineChildren script that uses CombineMeshes()
I was just poking around with this some more.
I noticed that the memory was holding still but the VBO total kept rising while recreating a mesh. So I tried eliminating the new Mesh(); line
The old version was making 2 VBOs which made no sense.
The “fix” in the last post made 1.
This version makes no extra VBOs and no memory increase (unless its a bigger mesh).
Seems to work.
Looks like you don’t need to make a new Mesh().
Just one more thing that was wrong with that example code
Eric5h5 made a new script that fixed all the problems with that example code. He kept the new mesh() line because it didnt break anything. But its also not needed at all. This is the problem with not being allowed to see the source code in CombineMeshes().
It seems that any creation of a new mesh, even though it never goes to the video card gets added to the VBO count and any explicit Destroy subtracts from that count. Not sure that the count is important anyway.