[petsc-dev] writing PETSc code with no memory leaks
Barry Smith
bsmith at mcs.anl.gov
Tue May 10 16:02:08 CDT 2011
On May 10, 2011, at 3:50 PM, Lisandro Dalcin wrote:
> On 10 May 2011 05:27, Barry Smith <bsmith at mcs.anl.gov> wrote:
>>
>> I find it very useful when writing PETSc code to keep the environmental variable
>>
>> export PETSC_OPTIONS="-malloc -malloc_debug -malloc_dump"
>>
>> where I run my test programs. This helps me see memory leaks immediately (where I forgot to destroy some objects or free some memory) rather than tracking down a ton of memory leaks months later. Suggest others do the same.
>>
>
> Is this used when you "make testexamples" ?
Yes. Occasionally I see a bad example or code and have to fix it. Though actually it is generally pretty clean.
Barry
>
>
> --
> Lisandro Dalcin
> ---------------
> CIMEC (INTEC/CONICET-UNL)
> Predio CONICET-Santa Fe
> Colectora RN 168 Km 472, Paraje El Pozo
> 3000 Santa Fe, Argentina
> Tel: +54-342-4511594 (ext 1011)
> Tel/Fax: +54-342-4511169
More information about the petsc-dev
mailing list