0

We can use Valgrind to find memory leaks on main() return. But, this is not the case here. The process will run forever. How to find the memory leak in this case.

I have used static analysis on source code to fix the leaks. But, If there are any places where static analysis failed and leaks. How to find those leaks?

Any help will be greatly appreciated!!

Saran-san
  • 361
  • 3
  • 14
  • Is there no defined way to end your process/daemon? E.g. by sending SIGTERM and an implemented signal handler. – Manuel Barbe Mar 20 '15 at 11:52
  • No, It is an embedded env process. It is not expected to end anytime. By adding exit(0) on sigterm handler, can I get the leak report on valgrind? – Saran-san Mar 20 '15 at 11:55
  • You should perform an orderly shutdown there, not simply calling exit(). Otherwise valgrind may report a lot of leaks caused by not correctly finishing threads etc. – Manuel Barbe Mar 20 '15 at 12:02

0 Answers0