This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Suggestion for memory leak detection


I am interested in making a modification to the cyg_mempool_fix (and
_var) and their underlying C++ classes to keep track in real time how
much memory is allocated.

My idea is this, if the appropriate CDL option is set on, every time:

* a heap is created
* a block of memory is allocated
* a block of memory is freed
* a heap is destroyed

A callback function will be invoked.

This will allow tasks to keep track of memory allocation in real time,
for high water marks etc.  You could also use it for visual
representation to detect when a memory allocation fails and stop the
system to debug since most embedded systems don't handle malloc failures
too gracefully.

What do you think of this as a feature?  I can implement it, the only
part I might stumble on would be the CDL.

-Rich


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]