[MOAB-dev] memory leak in ReadParallel class?

Tim Tautges tautges at mcs.anl.gov
Mon Jul 14 19:50:51 CDT 2008


That is correct, the ReadParallel class doesn't destroy the 
MBParallelComm objects it creates.  The primary reason I did it this way 
is because I store pointers to the MBPC objects as a tag on the 
interface instance, so that MBParallelComm::get_pcomm function (which is 
static) can get the indexed object.  I should probably put something in 
the MBCore destructor to check for this tag and delete any objects it finds.

Thanks for your interest, and if you see any other problems/bugs send 
'em in.  The parallel reader stuff is fairly new, so we're still finding 
bugs here and there.

- tim

Ryuta Suzuki wrote:
> Hi,
> 
> I've been playing around MOAB for a while to use it as parallel mesh 
> reader/writer.
> 
> I noticed that in RealParallel class, its constructor "new" the 
> MBParallelComm object but it doesn't delete the object at any point in 
> the class. I suppose it'd be natural that the ReadParallel destructor 
> should handle this memory allocation.
> 
> Running valgrind confirmed that MBParallelComm object is not correctly 
> freed.
> 
> Please correct me if I'm wrong. Thank you.
> 
> -ryuta
> 
> 

-- 
================================================================
"You will keep in perfect peace him whose mind is
   steadfast, because he trusts in you."               Isaiah 26:3

              Tim Tautges            Argonne National Laboratory
          (tautges at mcs.anl.gov)      (telecommuting from UW-Madison)
          phone: (608) 263-8485      1500 Engineering Dr.
            fax: (608) 263-4499      Madison, WI 53706




More information about the moab-dev mailing list