Need a tool to detect memory leaks in C code

前端 未结 6 1135
长发绾君心
长发绾君心 2021-02-11 00:16

Is there a good application (that has some kind of gui) for testing memory leaks in c code. I would really like to test my assignment/programme but being very new to this, i str

相关标签:
6条回答
  • 2021-02-11 00:36

    There's a gui for analyzing valgrind results: http://alleyoop.sourceforge.net/. Besides, there's (non-free) purify which is great, and i believe there's a trial. It has a GUI.


    0 讨论(0)
  • 2021-02-11 00:41

    If you're using Microsoft's DevStudio then the C run-time library has plenty of memory allocation tracking tools already built-in:

    The Debug Heap

    _CrtSetDbgFlag

    It amazes me how few programmers seem to be aware of these tools!

    0 讨论(0)
  • 2021-02-11 00:44

    On Windows, HeapMon may be of some interest, although it does not explicitly tell you where are your leaks.

    0 讨论(0)
  • 2021-02-11 00:51

    Purify is a great application for this.

    0 讨论(0)
  • 2021-02-11 00:51

    valgrind is pretty good on Linux, but it only has a command line interface

    0 讨论(0)
  • 2021-02-11 00:53

    Depending on the platform (you don't mention it) Valgrind is fantastic on Linux systems. It has no GUI, but doesn't need one.

    Just run valgrind <path to your application + arguments> and it will run your application and spit out any errors during memory operations.

    Add the --leak-check=full and --show-reachable=yes options after valgrind to get stack-traces of where your memory leaks originate.

    0 讨论(0)
提交回复
热议问题