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]

Re: Suggestion for memory leak detection


On Sun, 2002-09-15 at 08:40, NavEcos wrote:
> 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.

Sounds useful - go for it!

One thing to think about would be to write some tests that 
both utilize and test the facilities.  This is a good way
to verify that things work, as well as document how :-)

-- 
------------------------------------------------------------
Gary Thomas                  |
eCosCentric, Ltd.            |  
+1 (970) 229-1963            |  eCos & RedBoot experts
gthomas@ecoscentric.com      |
http://www.ecoscentric.com/  |
------------------------------------------------------------


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