[vorbis-dev] ogg vorbis dynamic memory allocation.

Segher Boessenkool segher at chello.nl
Sun Jul 1 04:10:35 PDT 2001



Firelight Multimedia wrote:
> 
> Hi,
> I finally got around to overriding ogg_malloc etc and running through my
> memory manager.  Thinking of limited memory consoles like PS2, I was

How much RAM does a PSX2 have?

> somewhat alarmed at what I found .. Admittedly I am using vorbisfile but
> that’s because its so easy to use :) ..

Vorbisfile shouldn't be a big overhead over straight libogg/libvorbis;
if it is, it's time we do something about it.

> Per ogg file my memory manager is telling me it is using 885,201 bytes
> per file (I thought I would maybe get a constant overhead and lower
> overhead per file but its 885k each time).

That's way too much, I think... you might forget to free memory?  If you've
overridden alloca() as well, you need to free that memeory at function
exit of the function that did the alloca() (or per C block, even).

> Ov_read reads 17k at a time in my streamer, and reducing it (to say 7k)
> made no difference.
> Is there a way to get this right down?  Remove vorbisfile I assume is
> the first thing (though I am loathe to do right now due to the extra
> complexity involved).  Mp3 currently uses about 32k of different buffers

That's not right; the tightest mp3 decoder I've seen needs about 48k
R/W memory, and there's not much opportunities left to reduce that.

> per file which is extremely efficient memory usage for consoles, is
> there any way vorbis might be able to get this low?

There's work being done to reduce Vorbis memory usage (as well as cpu
usage, and cache pressure).

> I havent had a look at static usage yet, id have to take a look at the
> map file for that.

> Any ideas or comments appreciated.

You can mail me your malloc() etc. implememntation, and I'll have a
look at it; and/or the raw output of your mem usage experiments.

Cheers,

Segher

--- >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 'vorbis-dev-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 Vorbis-dev mailing list