[petsc-users] PetscMallocAlign

Satish Balay balay at mcs.anl.gov
Wed Jan 12 13:36:30 CST 2011


perhaps you are missing a call to VecDestroy() on the vec created by
DACreateGlobalVector?

Satish

On Wed, 12 Jan 2011, Ataollah Mesgarnejad wrote:

> Dear All,
> 
> I have a memory leak problem with my program; it eventually exhausts all the memory on my system and program aborts. I was checking memory usage with Valgrind and there is a persistent error that always traces back PetscMallocAlign. Something like:
> 
> ==2918== 
> ==2918== 18,792 bytes in 2 blocks are possibly lost in loss record 2,256 of 2,257
> ==2918==    at 0x4A04360: memalign (vg_replace_malloc.c:532)
> ==2918==    by 0x8AC18A: PetscMallocAlign(unsigned long, int, char const*, char const*, char const*, void**) (mal.c:30)
> ==2918==    by 0x8ADA8E: PetscTrMallocDefault(unsigned long, int, char const*, char const*, char const*, void**) (mtr.c:192)
> ==2918==    by 0x9E4230: VecCreate_MPI_Private(_p_Vec*, PetscTruth, int, double const*) (pbvec.c:187)
> ==2918==    by 0x9E48EA: VecCreate_MPI (pbvec.c:232)
> ==2918==    by 0x9A9E12: VecSetType(_p_Vec*, char const*) (vecreg.c:54)
> ==2918==    by 0x9FEA80: VecCreateMPI(ompi_communicator_t*, int, int, _p_Vec**) (vmpicr.c:42)
> ==2918==    by 0xBBFA6C: DACreateGlobalVector(_p_DA*, _p_Vec**) (dadist.c:42)
> ==2918==    by 0x6CE34F: main (PFMAT-main.cpp:76)
> ==2918== 
> 
> 
> I'm wondering if this is related to a some error in my declarations or a  known issue or an issue at all? 
> 
> PS: I get the same kind of error both on my Mac os X 10.6 and Fedora 13.
> 
> Best,
> Ata Mesgarnejad



More information about the petsc-users mailing list