petsc-master 2019-12-15
Report Typos and Errors

PetscMallocSetDebug

Set's PETSc memory debugging

Synopsis

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

Input Parameter

eachcall - checks the entire heap of allocated memory for issues on each call to PetscMalloc() and PetscFree()
intializenan - initializes all memory with NaN to catch use of unintialized floating point arrays

Options Database

-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

See Also

CHKMEMQ(), PetscMallocValidate(), PetscMallocGetDebug()

Level

developer

Location

src/sys/memory/mtr.c
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages