S3DVertex major problem.

Discussion about Irrlicht's Java wrapper
Post Reply
MarcusD
Posts: 16
Joined: Sat Nov 27, 2010 12:57 pm
Location: South Yorkshire, UK

S3DVertex major problem.

Post by MarcusD »

For some reason, S3DVertex never releases memory. Calling .delete() does nothing either, also casting to the correct type such as S3DVertex2TCoords causes a runtime error. It seems bugged, I was trying to write a terrain editor in Jirr and converted a few C++ examples to Java, the main core of which involves grabbing the vertex data like this.

S3DVertex[] v=node.getMesh().getMeshBuffer(0).getVertices();

But every time this is run, more and more memory gets allocated and not freed up, to the point where the JVM crashes with OOM. I did try simply creating a single global instance of the array instead to stop this, but every time I access the getPos() method of the elements, the memory usage starts to pile up again. I'm a little baffled

Also, modifying the Y value of the getPos() vector3df has crazy incorrect results. Many of the values in the position vector when viewed show as NaN and the X and Z values are not what they should be.

Any solutions would be appreciated.

Thanks
Marc.
Post Reply