#include "petscsys.h" PetscErrorCode PetscMallocSetDebug(PetscBool eachcall, PetscBool initializenan)Not Collective
eachcall | - checks the entire heap of allocated memory for issues on each call to PetscMalloc() and PetscFree() | |
initializenan | - initializes all memory with NaN to catch use of uninitialized floating point arrays |
-malloc_debug <true or false> | - 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 <filename> | - 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 |
Notes: This is called in PetscInitialize() and should not be called elsewhere