:orphan:
# PetscMallocTraceSet
Trace all calls to `PetscMalloc()` 
## Synopsis
```
#include "petscsys.h" 
PetscErrorCode PetscMallocTraceSet(PetscViewer viewer, PetscBool active, PetscLogDouble logmin)
```
Not Collective


## Input Parameters

- ***viewer -*** The viewer to use for tracing, or `NULL` to use `PETSC_VIEWER_STDOUT_SELF`
- ***active -*** Flag to activate or deactivate tracing
- ***logmin -*** The smallest memory size that will be logged





## Note
The viewer should not be collective.


## See Also
 `PetscMallocTraceGet()`, `PetscMallocViewGet()`, `PetscMallocDump()`, `PetscMallocView()`, `PetscMalloc()`, `PetscFree()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/memory/mtr.c.html#PetscMallocTraceSet">src/sys/memory/mtr.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/memory/mtr.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
