Technical discussions related to Analog Devices DSPs (including Blackfin, TigerSHARC, SHARC and ADSP-21xx DSPs).
Hello,
Does anyone have any idea about how it would be possible to measure heap usage? For this
purpose, do we need to follow a statistical measurement approach?
Thanks
--
M u r a t A r t u n, MSc.
Design Engineer
"be conservative in what you do, be liberal in what you accept from others"
---------------------------------
Pinpoint customers who are looking for what you sell.
Hi,
A simple approach is to create a mutex object with all the necessary
statistics, modify its instant/cumulative value fields each time a local
allocation/free occurs and based on these, calculate extremas, averages
and other moments (whatever is needed) once per a time unit.
STRUCTURE HEAP_USAGE_MUTEX
begin
Heap_Size ; increment on alloc/ decrement on free
Min_Heap_Size ; update on each free
Max_Heap_Size ; update on each alloc
Cumulative_Alloc_Size ; init to 0, increment on alloc
Cumulative_Free_Size ; init to 0, increment on free
No_of_Allocs ; init to 0, increment on alloc
No_of_Frees ; init to 0, increment on free
... ; etc.
end
Rgds,
Andrew
(andrew dot nesterov at techemail dot com)
> Subject: measuring heap usage
> Posted by: "Murat Artun" m...@yahoo.com muratartun
> Date: Thu Aug 9, 2007 5:55 am ((PDT))
>
> Hello,
>
> Does anyone have any idea about how it would be possible to measure heap
> usage? For this purpose, do we need to follow a statistical measurement
> approach?
>
> Thanks
> --
> M u r a t A r t u n, MSc.
> Design Engineer
>
> "be conservative in what you do, be liberal in what you accept from others"
>
> ---------------------------------
> Pinpoint customers who are looking for what you sell.