Hi,
Dirk Reiners schrieb:
Hi Oliver,
On Mon, 2005-09-26 at 16:27 +0200, Oliver Kutter wrote:
Hi,
I have a problem with memory leaks in my application. I'm doing a
streamline visualization (as GL_LINE_STRIP) with a variable number of
geometries (from 50 up to 5000 streamlines). Every streamline is stored
in its own geometry.
When my visualization is done and I want to restart it, I call clear()
on the geometry points, colors, indices, length and normals. I store my
geometries and the other objects in GeometryPtr arrays,
GeoIndicesUI32Ptr arrays, and so on . When I change the number of my
streamlines, I clear the objects, detach the geometry nodes from the
scenegraph, delete the arrays and recreate them by setting up the
geometry objects again and adding them back to the scenegraph.
Now my Problem is, that I have memory leaks. It is clear, that my memory
consumption increases, when I create my visualization. But I thought, it
would decrease, when I call clear() or I detach the geometry node from
the scenegraph and delete the arrays. But that is not the case!
Has anyone an idea?
Clear() might not always help, that depends on the STL implementation.
Some just keep the memory around for next time the array grows.
But deleting objects should help. For testing you might want to make
sure that the ref count of your OpenSG objects really is 1 before your
final subRefCP() call, otherwise they won't be deleted. The easiest way
to make that pretty automatic is using RefPtrs instead of the usual
Ptrs.
If you can't solve it, can you try to recreate the effect in a tutorial-
style example? Like a tutorial that recreates the scene every frame the
same way you do or something like this?
Please, can someone explain me the following situation? When I run my
application with OpenSG dbg, everything is fine, the memory will be
freed after usage, but not in OpenSG opt mode. Why?
greetings
Oliver
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users