:orphan:
# PetscMallocView
Saves the log of all calls to `PetscMalloc()`; also calls `PetscMemoryGetMaximumUsage()` 
## Synopsis
```
#include "petscsys.h" 
PetscErrorCode PetscMallocView(FILE *fp)
```
Not Collective


## Input Parameter

- ***fp -*** file pointer; or `NULL`



## Options Database Key

- ***-malloc_view <optional filename> -*** Activates `PetscMallocView()` in `PetscFinalize()`





## Notes
`PetscMallocDump()` dumps only the currently unfreed memory, this dumps all memory ever allocated

`PetscMemoryView()` gives a brief summary of current memory usage


## Fortran Notes
The calling sequence in Fortran is `PetscMallocView`(integer ierr)


## See Also
 `PetscMallocGetCurrentUsage()`, `PetscMallocDump()`, `PetscMallocViewSet()`, `PetscMemoryView()`, `PetscMalloc()`, `PetscFree()`

## Level
advanced

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