[directmusic] Mem usage

  • From: "Aaron R Leiby" <aleiby@xxxxxxxxxxxxx>
  • To: <directmusic@xxxxxxxxxxxxx>
  • Date: Sun, 29 Sep 2002 18:58:31 -0400

Using my most scientific method of the TaskManager to track memory usage,
I'm noticing that with just a simple direct music script calling an empty
segment (tracks - tempo/timesig/wave/script), I'm getting about 2MB boost in
memory use (the container file itself is 1.46kb).  When I have a container
(similar structure) just with more segments, and actual wav data
(compressed), whose container weighs in at 3.08MBs, I'm seeing a 9MB boost
in memory use when I start the script (which includes initializing DM,
etc.).  Our largest container weighs in at a hefty 11.5MBs, and results in
over 22MBs increase memory use.  (Memory usage appears to fluctuate +/- 2MBs
over the course of playing.)

A) Does this sound right?

B) What are some methods for reducing this?

Some data points:

o We're using VBScript for the scripts (since they use select statements,
rand, global vars, etc.).
o Wav files are compressed using only Microsoft ADPCM.  We are shipping with
simple streaming ogg vorbis music for much of the game, so it may be worth
me spending time to hook up similar compression for DM use?
o Wav files are set Streaming with 500ms read ahead.
o Script is flagged with "Load all content when script is loaded" --
disabling this causes errors (apparently there is no automatic load on
demand support and something the application writer is expected to
provide?).
o Script is flagged with "Download all segments when script is loaded".

Ideally, I'd like to only incur a fixed overhead for initializing
DirectMusic, a small overhead for loading all the segment info, script, etc.
(structure stuff), and then whatever is required for the streaming wav pool
(which I would expect to be the largest overhead, but certainly not an order
of magnitude larger than the source material).


Thanks,

Aaron.




Other related posts: