Hello,

Thanks for your reply, and sorry for my very late reply, but i was busy trying 
a lot to get rid of the memory leak, i tried a lot of memory leak detectors 
with no luck. Now it's better but i still have big memory leak i used the code 
snippest at http://opensg.vrsource.org/trac/wiki/Tutorial/OpenSG1/Memleak of 
detecting the live FCs at exit, it helped me a lot, now i have 45 FCs that 
haven't been destroyed including images, which i believe it's the one taking 
memory, i also find shader parameters, and i have never used shaders in the 
program, i tried the following at the opening of a new file i added it to the 
code from the page
for(int i = 0; i < fc.getRefCount(); i++)
                subRef(fc);
it worked well in getting rid of memory leaks, but some times when i load 
another model the dll crashes, at random places in the program, by the way to 
step into the opensg code shouldn't i have *.dbg, or *.pdb files?
Also some times it works perfectly so i'm pretty confused.

Thanks,
Abdalla

Carsten Neumann <[EMAIL PROTECTED]> wrote:  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 
()? 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


       
---------------------------------
Never miss a thing.   Make Yahoo your homepage.
-------------------------------------------------------------------------
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