:orphan:
# PetscMemoryView
Shows the amount of memory currently being used in a communicator. 
## Synopsis
```
#include "petscsys.h" 
PetscErrorCode PetscMemoryView(PetscViewer viewer, const char message[])
```
Collective


## Input Parameters

- ***viewer -*** the viewer to output the information on
- ***message -*** string printed before values



## Options Database Keys

- ***-malloc_debug -*** have PETSc track how much memory it has allocated
- ***-log_view_memory -*** print memory usage per event when `-log_view` is used
- ***-memory_view -*** during `PetscFinalize()` have this routine called





## See Also
 `PetscMallocDump()`, `PetscMemoryGetCurrentUsage()`, `PetscMemorySetGetMaximumUsage()`, `PetscMallocView()`, `PetscMalloc()`, `PetscFree()`

## Level
intermediate

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