In article <[EMAIL PROTECTED]>,
 Benjamin Stauffer <[EMAIL PROTECTED]> 
 wrote:

> Hey everyone.  I'm working on my research project for college and I'm trying 
> to root out the memory leaks in my program.  My program collects data from a 
> sound card and analyzes it.  Unfortunately, I'm getting a 192-byte memory 
> leak, and I can't figure out where it's coming from.

That may be normal.

Is it really a growing leak, or just an increase of memory usage?

add_timeout actually grows an internal 'timeout' array if needed. When 
first called, it also does some initialization (like creating a dummy 
timer window handler) that allocates some extra memory.

> And then the loop itself in sd_win_coll.cxx (Data Collection window):
> void cb_coll_loop(void*)
> {
>   float window_ms;      // YES, I KNOW I COULD DO THESE BETTER, BUT I
>   float bestpeak_freq;  // HAVEN'T GOTTEN AROUND TO CHANGING THEM YET
>   rstream->audioSoFar(window_ms, bestpeak_freq);
>   main_graph->add_point(bestpeak_freq);
>   Fl::repeat_timeout(period, cb_coll_loop);
> }

I assume that without add_timeout this function is never called. In that 
case, audioSoFar and add_point could also be the reason.

I never used the google's leak checker, so I don't know if it's just 
reporting memory usage or does some more advanced checking. With a 
decent memory checker you can easily check where the leak is coming from 
(don't know any available for windows though).

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to