[tremor] Tremor Memory Footprint

Monty xiphmont at xiph.org
Mon Nov 25 09:19:19 PST 2002



On Wed, Nov 06, 2002 at 10:25:25AM -0500, Werner Sharp wrote:
> Hi all,
> 
> I'm using tremor in a Windows CE project that may be in a low memory
> situation when decoding the Ogg file.   If there's not enough memory
> available, tremor just crashes out because there's not any(?) out-of-memory
> checks.

There are none because they're useless on platforms that will happily
hand back pages that can't actually be mapped (aka 'lazy malloc').  On
such a platform, malloc will [virtually never] fail; you're expected
to catch the SEGV when the kernel tries to map the page and fails.

I didn't believe there were still any [serious] mutitasking OSes out
there that would not trap an exception in this case.  Even Windows is
[finally] up to speed on that.  WinCE should probably be handled as an
'embedded' case in which the _ogg_malloc is a wrapper around a
slab/ripcord allocator from a fixed-size chunk. 

>   Does anyone know if tremor has a general memory footprint required
> to decode a file?    I'm not talking about the file size itself (or its
> decoded size), just the internal data structures required.   I can purge
> objects from memory before calling tremor, I'm just trying to figure out how
> much to purge.

It depends on the file itself.  Vorbis is, in some ways, more like a
virtual machine than a simple codec, and the file has very wide
latitude in the way it sets up decode.  OTOH, it's perfectly
acceptible to simply not play back files that take more than available
memory, and encoder authors are encouraged to keep decode working
space requirements to a minimum.

Vorbis 1.0 files, IIRC, require about 128kB working space in Tremor
right now.  Actually, that number may be well out-of-date after
Nicolas's MDCT work.  I'll go have a look :-)

Monty
--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'tremor-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Tremor mailing list