PetscMallocSetDebug#

Set’s PETSc memory debugging

Synopsis#

#include "petscsys.h" 
PetscErrorCode PetscMallocSetDebug(PetscBool eachcall, PetscBool initializenan)

Not Collective

Input Parameters#

  • eachcall - checks the entire heap of allocated memory for issues on each call to PetscMalloc() and PetscFree(), slow

  • initializenan - initializes all memory with NaN to catch use of uninitialized floating point arrays

Options Database Keys#

  • -malloc_debug - turns on or off debugging

  • -malloc_test - turns on all debugging if PETSc was configured with debugging including -malloc_dump, otherwise ignored

  • -malloc_view_threshold t - log only allocations larger than t

  • -malloc_dump - print a list of all memory that has not been freed

  • -malloc no - (deprecated) same as -malloc_debug no

  • -malloc_log - (deprecated) same as -malloc_view

Note#

This is called in PetscInitialize() and should not be called elsewhere

See Also#

CHKMEMQ(), PetscMallocValidate(), PetscMallocGetDebug(), PetscMalloc(), PetscFree()

Level#

developer

Location#

src/sys/memory/mtr.c


Edit on GitLab

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages