Re: [osg-users] shutting down OSG

2009-02-02 Thread Adrian Egli OpenSceneGraph (3D)
Did the code help ?

/adrian

2009/1/30 Adrian Egli OpenSceneGraph (3D) 3dh...@gmail.com

 Hi Robert, Cory,

 I implement some weeks before a memory leak detector for VS 2005 and
 cleaned up the code that all of my objects get right removed from memory
 now, espacially i had some bad behaviour before
 cleaning up my webbased rendering plugin, after removing all memory leak
 even quicktime get closed without any crashes. so it's really important that
 all allocated memory gets
 fine removed. the plugin don't have some leaks coming through the OSG core,
 and believe me: our application is much more complex than just use some
 geometry nodes.
 and i can say that the osg core should be free of any memory leak, i
 suggest using in all user application the ref_ptr concept which robert is
 using in the core of osglib then you don't get some leaks.
 I also believe that there is also many false positives...

 Here is the code you should use :
 // memory leak check ...


 ---
 MEM_LEAK_BASE.h

 ---


 ---
 Just include this in each CPP file


 #ifdef MEM_LEAK_CHK
 #include DbgMemoryImpl.h
 #endif



 ---


 i hope this works also 

 /adrian


 2009/1/30 Robert Osfield robert.osfi...@gmail.com

 Hi Cory,

 I believe the are bugs in the memory tracking support in VS,
 especially when using MFC, that produce many false positives.  You'll
 need to get more info about this from VS experts though, the last time
 I used VS was in the last Century!

 Robert.

 On Fri, Jan 30, 2009 at 3:32 PM, Cory Riddell c...@codeware.com wrote:
  After my (MFC) app ends, the output window in Visual Studio fills with a
  bunch of this:
 
  Detected memory leaks!
  Dumping objects -{164} normal block at 0x02A54248, 128 bytes long.
   Data:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00
  {163} normal block at 0x02A541A8, 96 bytes long.
   Data:   c  F8 87 63 01 00 00 00 00 01 00 00 00 00 00 00
 00
  {161} normal block at 0x02A54068, 64 bytes long.
   Data: OpenThread v1.2p 4F 70 65 6E 54 68 72 65 61 64 20 76 31 2E 32
 70
 
  I'm just getting started with OSG. I'm using it to render geometry from
  Granite (the geometry kernel from the Pro/ENGINEER people, just getting
  started with this too). Both libraries have their own reference counted
  pointer types and they function a bit differently so I'm probably just
  abusing one or the other.
 
  Normally I can just pick one of the allocation numbers from the dump
 (161,
  163, and 164 above) and tell the debugger to stop there, but for some
 reason
  that isn't working. If I have time later today, I'm going to instrument
  everything with BoundsChecker and run it again.
 
  Cory
 
 
  On Fri, Jan 30, 2009 at 9:08 AM, Robert Osfield 
 robert.osfi...@gmail.com
  wrote:
 
  Hi Cory,
 
  The OSG users ref counting, so if all external references to the scene
  and viewer are removed then all the associated resources should be
  deleted automatically.  If you app keeps any references to this data
  then it'll stay around until these references are removed.
 
  If you've enabled caching in the osgDB::Registry then it can keep
  around a reference for loaded objects in its cache, so clearing this
  would be required.   Also if you app loads OSG plugins as part of
  loading your data then one could see this as items you might want to
  unload.
 
  BTW, what makes you think that things aren't being released?
 
  Robert.
 
  On Fri, Jan 30, 2009 at 2:57 PM, Cory Riddell c...@codeware.com
 wrote:
   Is there a correct way to stop OSG and free all the resources that
 have
   been
   acquired by without stopping the application? I thought that when my
   osgViewer::Viewer instance went out of scope, everything would be
   released,
   but that doesn't seem to be the case.
  
   cory
  
   ___
   osg-users mailing list
   osg-users@lists.openscenegraph.org
  
  
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
  
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___

[osg-users] shutting down OSG

2009-01-30 Thread Cory Riddell
Is there a correct way to stop OSG and free all the resources that have been
acquired by without stopping the application? I thought that when my
osgViewer::Viewer instance went out of scope, everything would be released,
but that doesn't seem to be the case.

cory
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] shutting down OSG

2009-01-30 Thread Robert Osfield
Hi Cory,

The OSG users ref counting, so if all external references to the scene
and viewer are removed then all the associated resources should be
deleted automatically.  If you app keeps any references to this data
then it'll stay around until these references are removed.

If you've enabled caching in the osgDB::Registry then it can keep
around a reference for loaded objects in its cache, so clearing this
would be required.   Also if you app loads OSG plugins as part of
loading your data then one could see this as items you might want to
unload.

BTW, what makes you think that things aren't being released?

Robert.

On Fri, Jan 30, 2009 at 2:57 PM, Cory Riddell c...@codeware.com wrote:
 Is there a correct way to stop OSG and free all the resources that have been
 acquired by without stopping the application? I thought that when my
 osgViewer::Viewer instance went out of scope, everything would be released,
 but that doesn't seem to be the case.

 cory

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] shutting down OSG

2009-01-30 Thread Cory Riddell
After my (MFC) app ends, the output window in Visual Studio fills with a
bunch of this:

 Detected memory leaks!
 Dumping objects -{164} normal block at 0x02A54248, 128 bytes long.
  Data:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 {163} normal block at 0x02A541A8, 96 bytes long.
  Data:   c  F8 87 63 01 00 00 00 00 01 00 00 00 00 00 00 00
 {161} normal block at 0x02A54068, 64 bytes long.
  Data: OpenThread v1.2p 4F 70 65 6E 54 68 72 65 61 64 20 76 31 2E 32 70


I'm just getting started with OSG. I'm using it to render geometry from
Granite (the geometry kernel from the Pro/ENGINEER people, just getting
started with this too). Both libraries have their own reference counted
pointer types and they function a bit differently so I'm probably just
abusing one or the other.

Normally I can just pick one of the allocation numbers from the dump (161,
163, and 164 above) and tell the debugger to stop there, but for some reason
that isn't working. If I have time later today, I'm going to instrument
everything with BoundsChecker and run it again.

Cory


On Fri, Jan 30, 2009 at 9:08 AM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi Cory,

 The OSG users ref counting, so if all external references to the scene
 and viewer are removed then all the associated resources should be
 deleted automatically.  If you app keeps any references to this data
 then it'll stay around until these references are removed.

 If you've enabled caching in the osgDB::Registry then it can keep
 around a reference for loaded objects in its cache, so clearing this
 would be required.   Also if you app loads OSG plugins as part of
 loading your data then one could see this as items you might want to
 unload.

 BTW, what makes you think that things aren't being released?

 Robert.

 On Fri, Jan 30, 2009 at 2:57 PM, Cory Riddell c...@codeware.com wrote:
  Is there a correct way to stop OSG and free all the resources that have
 been
  acquired by without stopping the application? I thought that when my
  osgViewer::Viewer instance went out of scope, everything would be
 released,
  but that doesn't seem to be the case.
 
  cory
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] shutting down OSG

2009-01-30 Thread Robert Osfield
Hi Cory,

I believe the are bugs in the memory tracking support in VS,
especially when using MFC, that produce many false positives.  You'll
need to get more info about this from VS experts though, the last time
I used VS was in the last Century!

Robert.

On Fri, Jan 30, 2009 at 3:32 PM, Cory Riddell c...@codeware.com wrote:
 After my (MFC) app ends, the output window in Visual Studio fills with a
 bunch of this:

 Detected memory leaks!
 Dumping objects -{164} normal block at 0x02A54248, 128 bytes long.
  Data:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 {163} normal block at 0x02A541A8, 96 bytes long.
  Data:   c  F8 87 63 01 00 00 00 00 01 00 00 00 00 00 00 00
 {161} normal block at 0x02A54068, 64 bytes long.
  Data: OpenThread v1.2p 4F 70 65 6E 54 68 72 65 61 64 20 76 31 2E 32 70

 I'm just getting started with OSG. I'm using it to render geometry from
 Granite (the geometry kernel from the Pro/ENGINEER people, just getting
 started with this too). Both libraries have their own reference counted
 pointer types and they function a bit differently so I'm probably just
 abusing one or the other.

 Normally I can just pick one of the allocation numbers from the dump (161,
 163, and 164 above) and tell the debugger to stop there, but for some reason
 that isn't working. If I have time later today, I'm going to instrument
 everything with BoundsChecker and run it again.

 Cory


 On Fri, Jan 30, 2009 at 9:08 AM, Robert Osfield robert.osfi...@gmail.com
 wrote:

 Hi Cory,

 The OSG users ref counting, so if all external references to the scene
 and viewer are removed then all the associated resources should be
 deleted automatically.  If you app keeps any references to this data
 then it'll stay around until these references are removed.

 If you've enabled caching in the osgDB::Registry then it can keep
 around a reference for loaded objects in its cache, so clearing this
 would be required.   Also if you app loads OSG plugins as part of
 loading your data then one could see this as items you might want to
 unload.

 BTW, what makes you think that things aren't being released?

 Robert.

 On Fri, Jan 30, 2009 at 2:57 PM, Cory Riddell c...@codeware.com wrote:
  Is there a correct way to stop OSG and free all the resources that have
  been
  acquired by without stopping the application? I thought that when my
  osgViewer::Viewer instance went out of scope, everything would be
  released,
  but that doesn't seem to be the case.
 
  cory
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] shutting down OSG

2009-01-30 Thread Tomlinson, Gordon
Do a search of the mail archive this problem with false leaks in MFC has
been discussed exhaustively with various methods shown on how to work
around the MFC bugs that produce false leaks 



Gordon

__
Gordon Tomlinson

Product Manager 3D
Email  : gtomlinson @ overwatch.textron.com
__
(C): (+1) 571-265-2612
(W): (+1) 703-437-7651

Self defence is not a function of learning tricks 
but is a function of how quickly and intensely one 
can arouse one's instinct for survival 
- Master Tambo Tetsura

 

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert
Osfield
Sent: Friday, January 30, 2009 11:10 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] shutting down OSG

Hi Cory,

I believe the are bugs in the memory tracking support in VS, especially
when using MFC, that produce many false positives.  You'll need to get
more info about this from VS experts though, the last time I used VS was
in the last Century!

Robert.

On Fri, Jan 30, 2009 at 3:32 PM, Cory Riddell c...@codeware.com wrote:
 After my (MFC) app ends, the output window in Visual Studio fills with

 a bunch of this:

 Detected memory leaks!
 Dumping objects -{164} normal block at 0x02A54248, 128 bytes long.
  Data:  00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00
 {163} normal block at 0x02A541A8, 96 bytes long.
  Data:   c  F8 87 63 01 00 00 00 00 01 00 00 00 00 00
00 00
 {161} normal block at 0x02A54068, 64 bytes long.
  Data: OpenThread v1.2p 4F 70 65 6E 54 68 72 65 61 64 20 76 31 2E 
 32 70

 I'm just getting started with OSG. I'm using it to render geometry 
 from Granite (the geometry kernel from the Pro/ENGINEER people, just 
 getting started with this too). Both libraries have their own 
 reference counted pointer types and they function a bit differently so

 I'm probably just abusing one or the other.

 Normally I can just pick one of the allocation numbers from the dump 
 (161, 163, and 164 above) and tell the debugger to stop there, but for

 some reason that isn't working. If I have time later today, I'm going 
 to instrument everything with BoundsChecker and run it again.

 Cory


 On Fri, Jan 30, 2009 at 9:08 AM, Robert Osfield 
 robert.osfi...@gmail.com
 wrote:

 Hi Cory,

 The OSG users ref counting, so if all external references to the 
 scene and viewer are removed then all the associated resources should

 be deleted automatically.  If you app keeps any references to this 
 data then it'll stay around until these references are removed.

 If you've enabled caching in the osgDB::Registry then it can keep 
 around a reference for loaded objects in its cache, so clearing this
 would be required.   Also if you app loads OSG plugins as part of
 loading your data then one could see this as items you might want to 
 unload.

 BTW, what makes you think that things aren't being released?

 Robert.

 On Fri, Jan 30, 2009 at 2:57 PM, Cory Riddell c...@codeware.com
wrote:
  Is there a correct way to stop OSG and free all the resources that 
  have been acquired by without stopping the application? I thought 
  that when my osgViewer::Viewer instance went out of scope, 
  everything would be released, but that doesn't seem to be the case.
 
  cory
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegra
  ph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph
 .org


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
 org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] shutting down OSG

2009-01-30 Thread Adrian Egli OpenSceneGraph (3D)
Hi Robert, Cory,

I implement some weeks before a memory leak detector for VS 2005 and cleaned
up the code that all of my objects get right removed from memory now,
espacially i had some bad behaviour before
cleaning up my webbased rendering plugin, after removing all memory leak
even quicktime get closed without any crashes. so it's really important that
all allocated memory gets
fine removed. the plugin don't have some leaks coming through the OSG core,
and believe me: our application is much more complex than just use some
geometry nodes.
and i can say that the osg core should be free of any memory leak, i suggest
using in all user application the ref_ptr concept which robert is using in
the core of osglib then you don't get some leaks.
I also believe that there is also many false positives...

Here is the code you should use :
// memory leak check ...

---
MEM_LEAK_BASE.h
---

---
Just include this in each CPP file


#ifdef MEM_LEAK_CHK
#include DbgMemoryImpl.h
#endif


---


i hope this works also 

/adrian


2009/1/30 Robert Osfield robert.osfi...@gmail.com

 Hi Cory,

 I believe the are bugs in the memory tracking support in VS,
 especially when using MFC, that produce many false positives.  You'll
 need to get more info about this from VS experts though, the last time
 I used VS was in the last Century!

 Robert.

 On Fri, Jan 30, 2009 at 3:32 PM, Cory Riddell c...@codeware.com wrote:
  After my (MFC) app ends, the output window in Visual Studio fills with a
  bunch of this:
 
  Detected memory leaks!
  Dumping objects -{164} normal block at 0x02A54248, 128 bytes long.
   Data:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00
  {163} normal block at 0x02A541A8, 96 bytes long.
   Data:   c  F8 87 63 01 00 00 00 00 01 00 00 00 00 00 00
 00
  {161} normal block at 0x02A54068, 64 bytes long.
   Data: OpenThread v1.2p 4F 70 65 6E 54 68 72 65 61 64 20 76 31 2E 32
 70
 
  I'm just getting started with OSG. I'm using it to render geometry from
  Granite (the geometry kernel from the Pro/ENGINEER people, just getting
  started with this too). Both libraries have their own reference counted
  pointer types and they function a bit differently so I'm probably just
  abusing one or the other.
 
  Normally I can just pick one of the allocation numbers from the dump
 (161,
  163, and 164 above) and tell the debugger to stop there, but for some
 reason
  that isn't working. If I have time later today, I'm going to instrument
  everything with BoundsChecker and run it again.
 
  Cory
 
 
  On Fri, Jan 30, 2009 at 9:08 AM, Robert Osfield 
 robert.osfi...@gmail.com
  wrote:
 
  Hi Cory,
 
  The OSG users ref counting, so if all external references to the scene
  and viewer are removed then all the associated resources should be
  deleted automatically.  If you app keeps any references to this data
  then it'll stay around until these references are removed.
 
  If you've enabled caching in the osgDB::Registry then it can keep
  around a reference for loaded objects in its cache, so clearing this
  would be required.   Also if you app loads OSG plugins as part of
  loading your data then one could see this as items you might want to
  unload.
 
  BTW, what makes you think that things aren't being released?
 
  Robert.
 
  On Fri, Jan 30, 2009 at 2:57 PM, Cory Riddell c...@codeware.com
 wrote:
   Is there a correct way to stop OSG and free all the resources that
 have
   been
   acquired by without stopping the application? I thought that when my
   osgViewer::Viewer instance went out of scope, everything would be
   released,
   but that doesn't seem to be the case.
  
   cory
  
   ___
   osg-users mailing list
   osg-users@lists.openscenegraph.org
  
  
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
  
  
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org