[vtkusers] Vtk nightlies and Win2000 -- Unloading the DLLs
JJ_Tian at moldflow.com
JJ_Tian at moldflow.com
Mon Aug 28 10:00:04 EDT 2000
Several weeks ago I reported a memory leak which may be related to
what you found.
The memory of vtkObjectFactory::RegisterdFactories is allocated in
vtkObjectFactory::Init(); but it is never released because the
UnRegisterAllFactories function is not called automatically. This causes a
mem leak of 40 bytes (not 4MB).
I added the following in my code and solved the problem. There may be
better ways to do the same.
class COFMgr
{
public:
COFMgr()
{
// vtkObjectFactory::Init();//it must be called by the first ::New()
function
};
~COFMgr()
{
vtkObjectFactory::UnRegisterAllFactories();
}
};
static COFMgr ofMgr;
Nigel Nunn
<nNunn at ausport.gov.au> To: vtkusers at public.kitware.com
Sent by: cc:
vtkusers-admin at public.k Subject: [vtkusers] Vtk nightlies and Win2000 -- Unloading the DLLs
itware.com
08/27/00 12:48 PM
I recently noticed that exiting a Vtk application does not
appear to release the 40 MB of memory that seems to be used
by the set of DLLs we build from the nightly vtk source.
This initial loss of RAM only happens once, so I assume the
DLLs are remaining loaded after a Vtk-enabled program exits.
Of more concern is that we loose a further 4MB after starting
and stopping any application that calls the Vtk libraries.
This applies to TCL demos, the basic MFC Win32 Sample, as well
as our own MFC-based application. This means that after running
our application ten times, or even 10 TCL examples, we have lost
40 + (10*4) = 80 MB of RAM. Only way to recover seems to be
rebooting. Logging off then on does not recover this memory.
I cannot recall if this also happened under WinNT 4.0.
What sort of implicit linking does PCMAKER set up for the
Win32 DLLs? Does this need different treatment under Win2000?
We are using Windows 2000 and Vtk nightlies from May and
August on Pentium II & III multiprocessor boxes.
Thanks,
Nigel
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: <
http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list