Valgrind Detects Memory Leak Without Program Termination

Is it possible for Valgrind to detect an achievable / memory leak without stopping the program?

That is, how to find out the result before exiting the program?

+4
source share
1 answer

If you run the program under GDB, then there are some options described in the documentation, in particular, the MemCheck Monitoring Commands section , in particular, one of the mentioned commands leak_check:

  • leak_check [full*|summary] [kinds <set>|reachable|possibleleak*|definiteleak] [heuristics heur1,heur2,...] [increased*|changed|any] [unlimited*|limited <max_loss_records_output>]Performs leak check. The * character in the arguments indicates the default values.

[full*|summary] , ; . : , , . , , . , , . . , , , , . , .

, . <set> --show-leak-kinds. , definiteleak kinds definite, possibleleak kinds definite,possible: , , . I.e , . (.. ).

, . <set> --leak-check-heuristics. - none.

[increased*|changed|any] , . , , . , , . any , - . , .

Etc.

, Client Requests API, C. :

  • VALGRIND_DO_LEAK_CHECK: (, --leak-check=full) . . .
+1

All Articles