CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Heap statistics

  1. #1
    Join Date
    Apr 1999
    Location
    Plovdiv, BULGARIA, EUROPE
    Posts
    5

    Heap statistics

    Has somebody tried to get specified statistics about heap allcations/frees on per-thread/per function level?
    Is somewhere a class, which could give me information about heap allocations/deletions (the best would be this class to have an activate/deactivate function, because I need only partial statistics - in one part of the code)...


  2. #2
    Join Date
    Apr 1999
    Posts
    383

    Re: Heap statistics

    MFC's DEBUG_NEW enables this kind of stuff. When you compile a debug version of your program, DEBUG_NEW keeps track of the file name and line number for each object that it allocates. Then, when you call DumpAllObjectsSince, as described in the topic 'Dumping All Objects', each object allocated with DEBUG_NEW will be shown with the file and line number where it was allocated, thus allowing you to pinpoint the sources of memory leaks, etc.

    Check out 'Tracking Memory Allocations' in the online docs.

    Dave




  3. #3
    Join Date
    May 1999
    Location
    Oregon, USA
    Posts
    302

    Re: Heap statistics

    Also have a look at _heapwalk. It requires a bit of effort on your part to use however.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured