# which method/tool is best to check memory leak for VTK programs on Ubuntu? vtkDebugLeaks enough? or Valgrind/ASan?

**URL:** https://discourse.vtk.org/t/which-method-tool-is-best-to-check-memory-leak-for-vtk-programs-on-ubuntu-vtkdebugleaks-enough-or-valgrind-asan/12461
**Category:** Support
**Created:** [October 10, 2023, 3:09am UTC](https://discourse.vtk.org/t/which-method-tool-is-best-to-check-memory-leak-for-vtk-programs-on-ubuntu-vtkdebugleaks-enough-or-valgrind-asan/12461 "2023-10-10T03:09:36Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [October 10, 2023, 6:25am UTC](https://discourse.vtk.org/t/which-method-tool-is-best-to-check-memory-leak-for-vtk-programs-on-ubuntu-vtkdebugleaks-enough-or-valgrind-asan/12461/2 "2023-10-10T06:25:45Z")

</div>

VTK\_DEBUG\_LEAKS

> [@New feature: getting a stack trace on leaked objects with VTK\_DEBUG\_LEAKS](https://discourse.vtk.org/t/new-feature-getting-a-stack-trace-on-leaked-objects-with-vtk-debug-leaks/835):
>
> I just merged a [new feature](https://gitlab.kitware.com/vtk/vtk/merge_requests/5448) to VTK that augments vtkDebugLeaks. This feature lets you record a stack trace where leaked VTK objects were allocated. This can be a very useful when debugging VTK object leaks. Previously, if you configured VTK with VTK\_DEBUG\_LEAKS set to ON, VTK would report the types of VTK objects that were never deleted and how many there were when the application exited. This was a useful feature to let you know there was a leak, but it didn’t provide much insight into where t…

---

_[View the full topic](https://discourse.vtk.org/t/which-method-tool-is-best-to-check-memory-leak-for-vtk-programs-on-ubuntu-vtkdebugleaks-enough-or-valgrind-asan/12461)._
