This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Suggestion for memory leak detection
- From: NavEcos <ecos at navosha dot com>
- To: ecos-patches at sources dot redhat dot com
- Date: 15 Sep 2002 07:40:14 -0700
- Subject: 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