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?

Yours

        Dirk




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. 
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to