:orphan:
# PetscMallocViewSet
Activates logging of all calls to `PetscMalloc()` with a minimum size to view 
## Synopsis
```
#include "petscsys.h" 
PetscErrorCode PetscMallocViewSet(PetscLogDouble logmin)
```
Not Collective


## Input Parameter

- ***logmin -*** minimum allocation size to log, or `PETSC_DEFAULT` to log all memory allocations



## Options Database Keys

- ***-malloc_view <optional filename> -*** Activates `PetscMallocView()` in `PetscFinalize()`
- ***-malloc_view_threshold <min> -*** Sets a minimum size if -malloc_view is used
- ***-log_view_memory -*** view the memory usage also with the -log_view option





## Note
Must be called after `PetscMallocSetDebug()`


## Developer Note
Uses `MPI_COMM_WORLD` to determine rank because PETSc communicators may not be available


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

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/memory/mtr.c.html#PetscMallocViewSet">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)  
