# PETSc Stokes memory issue

**URL:** <https://community.freefem.org/t/petsc-stokes-memory-issue/2143>\
**Category:** General Discussion\
**Created:** [November 25, 2022, 9:42am UTC](https://community.freefem.org/t/petsc-stokes-memory-issue/2143 "2022-11-25T09:42:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![agTSL](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@agTSL](https://community.freefem.org/u/agTSL)\
**Post date:** [November 25, 2022, 9:42am UTC](https://community.freefem.org/t/petsc-stokes-memory-issue/2143/1 "2022-11-25T09:42:37Z")

</div>

Hello,

I am trying to solve a Stokes problem with PETSc on an “large” mesh.  
I do freefem exemple stokes-fieldsplit-3d-PETSc.edp and the exemple [here](https://joliv.et/FreeFem-tutorial/section_8/example10.edp.html).  
When the mesh have 530 000 elements the use of memory is around 90% and with a mesh \> 580 000 elements the use of memory is 100% and the calculation stop.

I am not familiar with PETSc and large mesh solve by freefem but I am little bit surprised by the memory usage do by PETSc.

**configuration :**

- UBUNTU 20.04
- freefem 4.11
- 32\*2 procs and 32G0 of memory

**error message :**

> Primary job terminated normally, but 1 process returned  
> a non-zero exit code. Per user-direction, the job has been aborted.
> 
> mpiexec noticed that process rank 15 with PID 0 on node tsl-ordi24 exited on signal 9 (Killed).

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 25, 2022, 1:54pm UTC](https://community.freefem.org/t/petsc-stokes-memory-issue/2143/2 "2022-11-25T13:54:14Z")

</div>

Does it work with a smaller mesh? Then either use a bigger machine, or a cheaper preconditioner to solve the problem.

---

<div class="post-metadata">

**Author:** ![agTSL](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@agTSL](https://community.freefem.org/u/agTSL)\
**Post date:** [November 25, 2022, 3:40pm UTC](https://community.freefem.org/t/petsc-stokes-memory-issue/2143/3 "2022-11-25T15:40:06Z")

</div>

Hello,

Yes it works with a smaller mesh (up to 530 000 tetrahedrons).  
Unfortunately it is my biggest machine, 32Go of memory is not enough?  
I will try with another conditioner.

Thanks you  
Alexandre

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 25, 2022, 3:44pm UTC](https://community.freefem.org/t/petsc-stokes-memory-issue/2143/4 "2022-11-25T15:44:22Z")

</div>

It can be enough depending on how you precondition the problem.
