[Speex-dev] [PATCH] Robust handling of low-memory conditions

Alfred E. Heggestad alfredh at owera.com
Sat Dec 3 09:20:07 PST 2005


Hi

here is a patch adding robust handling of low-memory conditions
(return value of speex_alloc() is checked) for nb_celp.c, sb_celp.c
and preprocess.c - jitter/echo is not updated.


  http://db.org/~alfredh/patch/speex-oom-1.diff


I have tested this in my low-memory environment, allocating
decoders/encoders for all heap values between 1 and X with
no memory leaks. Some data is here:


sample rate:		8000 Hz
heap free threshold:	9652 bytes (Pre-processor disabled)
heap free threshold:	27392 bytes (Pre-processor enabled)
result:			OK (no leaks)

sample rate:		16000 Hz
heap free threshold:	27916 bytes (Pre-processor disabled)
heap free threshold:	62936 bytes (Pre-processor enabled)
result:			OK (no leaks)

sample rate:		32000 Hz
heap free threshold:	62340 bytes (Pre-processor disabled)
heap free threshold:	131920 bytes (Pre-processor enabled)
pre-processor:		disable
result:			OK (no leaks)


(the heap free threshold value indicates how much heap must be
 available to allocate one Speex encoder+decoder with the given
 parameters)


/alfred

-- 
---------------------
Alfred E. Heggestad
Owera AS
sip:alfredh at owera.com
---------------------




More information about the Speex-dev mailing list