Hello Adballa,

abdalla ramadan wrote:
> I have problems with memory leaking, the main problem is that i'm 
> working on a dll which loads a 3d file like this so i have to free the 
> memory before loading another file, loading unloading too many files 
> make crash due to memory failure in my dll
> 
> osg::NodePtr model = SceneFileHandler::the().read(filename.c_str(), 
> graphOperator);
> 
> m_scene.node()->addChild(model); //m_scene is declared like this 
> GroupNodePtr m_scene;
> 
> in another function
> 
> m_scene.node()->subChild(0);
> 
> of course there's a lot of other great leakings in the program but i 
> didn't locate exactly those, but i could locate this, so i think i 
> should solve this leaking first, the main problem is the the memory 
> allocated by the first line, is much greater than the memory freed by 
> the last line, i used task manager and set break points to see this.

hm, is it possible that you still have a reference to the child you are 
removing in the code above ?
Also, the task manager is probably not an accurate tool to diagnose 
memory leaks, as the memory might only be released to the runtime memory 
allocator, but not to the system.
Have you looked at the tutorial page on memory leaks 
(<http://opensg.vrsource.org/trac/wiki/Tutorial/OpenSG1/Memleak>)? Maybe 
it gives you some hints on where to look.
Please note that the website might be a bit difficult to reach, as there 
is some maintenance going on (see the thread titled: "Server Maintenance").

        Hope it helps,
                Carsten

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to