[petsc-dev] valgrind appears to show memory leak related to PetscViewerBinaryOpen

Jed Brown jed at 59A2.org
Wed Jun 1 11:21:10 CDT 2011


On Wed, Jun 1, 2011 at 18:05, Brad Aagaard <baagaard at usgs.gov> wrote:

> Valgrind is suggesting that I may have a memory leak associated with
> PetscViewer objects in PyLith. I created a simple example (attached) that
> reproduces the valgrind message.
>

Most of your messages are just because Open MPI is leaky (harmlessly, except
for the valgrind noise). The real leak is because PetscViewerBinaryOpen()
creates a new viewer. Its implementation looks like the following.

  ierr = PetscViewerCreate(comm,binv);CHKERRQ(ierr);
  ierr = PetscViewerSetType(*binv,PETSCVIEWERBINARY);CHKERRQ(ierr);
  ierr = PetscViewerFileSetMode(*binv,type);CHKERRQ(ierr);
  ierr = PetscViewerFileSetName(*binv,name);CHKERRQ(ierr);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110601/64e9695e/attachment.html>


More information about the petsc-dev mailing list