# Memory leak with tetgconvexhull

**URL:** <https://community.freefem.org/t/memory-leak-with-tetgconvexhull/4107>\
**Category:** General Discussion\
**Created:** [October 20, 2025, 11:19am UTC](https://community.freefem.org/t/memory-leak-with-tetgconvexhull/4107 "2025-10-20T11:19:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [October 20, 2025, 11:19am UTC](https://community.freefem.org/t/memory-leak-with-tetgconvexhull/4107/1 "2025-10-20T11:19:24Z")

</div>

It seems that there is a problem with `tetgconvexhull`, it generates the message

```auto
######## We forget of deleting 1 Nb pointer, 0Bytes , mpirank 0, memory leak =12320
 CodeAlloc : nb ptr 4164, size :534928 mpirank: 0
Ok: Normal End

```

It happens for example with the code [3D cube with 1D-Line in the middle - #8 by fb77](https://community.freefem.org/t/3d-cube-with-1d-line-in-the-middle/4104/8)  
There is probably a pointer that is not deleted in the plugin `tetgen.cpp`

---

<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:** [October 20, 2025, 12:53pm UTC](https://community.freefem.org/t/memory-leak-with-tetgconvexhull/4107/2 "2025-10-20T12:53:53Z")

</div>

In most instances, you should not trust the built-in memory checker which gives many false positives. For this one though, it is a valid leak, fixed at [Fix memory leak in tetgen.cpp · FreeFem/FreeFem-sources@4a00304 · GitHub](https://github.com/FreeFem/FreeFem-sources/commit/4a00304ba12b0e20c7ba295e2659b2879e576584). Thanks for your report.

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [October 20, 2025, 1:36pm UTC](https://community.freefem.org/t/memory-leak-with-tetgconvexhull/4107/3 "2025-10-20T13:36:58Z")

</div>

Thanks for your quick answer and fix!
