|
From: Stefan K. <en...@ho...> - 2007-05-11 07:10:09
|
hi, my appologies firstm this is a bit like thinking aloud.... I wonder if long running programms fragment heap and stack space. For the stack it probably less of a problem as its grows and shrinks. If its a problem for the heap I wonder if one could write a valgrind tool that could meassure it and draw a graph that shows fragmentation over time. I thought a bit about how to express fragmentation in %: * having one totally empty space (.) ofcourse is 0% [........] * having two segments (allocated (#), freed (.)) is still 0% [####....] it does not matter if the allocated segment isone allocation or multiple * having alternating allcated and free space of byte is the worst case: 100% [#.#.#.#.] So is we have n bytes of memory and (n/2) alllocated/free segment boundaries its 100%. Does this make sense? Any one capable of implementing it? Stefan |