# Profile memory in freefem

**URL:** https://community.freefem.org/t/profile-memory-in-freefem/1092
**Category:** General Discussion
**Created:** [July 12, 2021, 8:09am UTC](https://community.freefem.org/t/profile-memory-in-freefem/1092 "2021-07-12T08:09:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)
#### Post date: [July 12, 2021, 8:09am UTC](https://community.freefem.org/t/profile-memory-in-freefem/1092/1 "2021-07-12T08:09:19Z")

</div>

Dear all, is there a method to print memery in FreeFem, so that we would know which lines of the code consumes the most memery?  
Yongxing

---

<div class="post-metadata">

### Author: ![aszaboa](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/aszaboa/32/2918_2.png) [@aszaboa](https://community.freefem.org/u/aszaboa)
#### Post date: [October 12, 2022, 1:59pm UTC](https://community.freefem.org/t/profile-memory-in-freefem/1092/2 "2022-10-12T13:59:49Z")

</div>

I also faced the same issue, and I found that in the current version of PETSc one can monitor memory quite precisely using command-line arguments `-memory_view`,`-log_view_memory` and `-malloc_view `. See [PetscMallocView](https://petsc.org/release/docs/manualpages/Sys/PetscMallocView/) and [PetscMemoryView](https://petsc.org/release/docs/manualpages/Sys/PetscMemoryView/) for more info about these options.
