# PetscMemorySetGetMaximumUsage
Tells PETSc to monitor the maximum memory usage so that `PetscMemoryGetMaximumUsage()` will work. 
## Synopsis
```
#include "petscsys.h" 
PetscErrorCode PetscMemorySetGetMaximumUsage(void)
```
Not Collective


## Options Database Key

- ***-memory_view -*** Print memory usage at end of run
- ***-log_view_memory -*** Print memory information per event
- ***-malloc_log -*** Activate logging of memory usage





## See Also
 `PetscMallocGetMaximumUsage()`, `PetscMemoryGetCurrentUsage()`, `PetscMallocGetCurrentUsage()`,
`PetscMemoryGetMaximumUsage()`

## Level
intermediate

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


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


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