Opened 11 years ago

Closed 9 years ago

#66 closed enhancement (wontfix)

Tracing memory allocation

Reported by: li@… Owned by:
Priority: minor Milestone:
Component: HM Version:
Keywords: Cc: fbossen, ksuehring, davidf, jct-vc@…

Description

Recently, we have many problems related to improper memory usage, such as memory leak (ticket #13,#14,#18,#19,#65), excessive memory allocation (ticket #57), too many times of memory allocation (ticket #21). To ease the detection of memory problems, a memory tracing tool is proposed. A patch based on revision 176 is attached (most of revisions are replacement of conventional memory allocation functions with new macros). The features of the tool are as follows.

1, Log of memory leak (file and line).
2, Log of memory usage (how much memory is allocated and times of memory allocation) during encoding/decoding.
3, Log of memory usage of each cpp/h file.
4, Print out the memory usage information during encoding/decoding.

Further features can be easily added if necessary.

With the memory log information, any memory leak or improper memory usage can be easily noticed by algorithm proponents and software coordinators.

The tool is easy to use. After including tool_tracemem.cpp and tool_tracemem.h into source/Lib/TLibCommon, what you have to do is using new macro MEMNEW/MEMDELETE to replace the conventional new/delete.

Attachments (2)

tracemem.patch (120.9 KB) - added by li@… 11 years ago.
Patch based on revision 176
tracemem.2.patch (120.9 KB) - added by li@… 11 years ago.
The patch has been updated to revision 178.

Download all attachments as: .zip

Change History (7)

Changed 11 years ago by li@…

Patch based on revision 176

comment:1 Changed 11 years ago by tung@…

Why not overload new and delete operator instead of change every new/delete by the macro?

Changed 11 years ago by li@…

The patch has been updated to revision 178.

comment:2 Changed 10 years ago by davidf

  • Component set to HM

Updating component after adding WD (Text) tickets

comment:3 Changed 10 years ago by davidf

  • Cc fbossen ksuehring davidf added

comment:4 Changed 10 years ago by davidf

  • Cc jct-vc@… added

comment:5 Changed 9 years ago by ksuehring

  • Resolution set to wontfix
  • Status changed from new to closed

As mentioned before there exist a number of 3rd party tools and libraries that can trace memory allocation (e.g. Valgrind, Visual Leak Detector, Purify, etc.). I don't see a need to modify our software.

Note: See TracTickets for help on using tickets.

This list contains all users that will be notified about changes made to this ticket.

These roles will be notified: Reporter, Owner, Subscriber, Participant

  • David Flynn(Subscriber, Participant)
  • Frank Bossen(Subscriber)
  • jct-vc@…(Subscriber)
  • karl.sharman@…(Always)
  • Karsten Suehring(Subscriber, Participant, Always)
  • li@…(Reporter)
  • tung@…(Participant)