[directmusic] Re: Mem usage

  • From: "Aaron R Leiby" <aleiby@xxxxxxxxxxxxx>
  • To: <directmusic@xxxxxxxxxxxxx>
  • Date: Sun, 29 Sep 2002 22:41:43 -0400

Setting "Don't pre-roll" dropped the 22MB usage down to about 6MBs.  Much
closer to my initial expectations.  Many thanks Scott.

Any additional hints and tips for reducing runtime memory usage are still
certainly welcome, though this is definitely a good start.


Aaron

----- Original Message -----
From: "Aaron R Leiby" <aleiby@xxxxxxxxxxxxx>
To: <directmusic@xxxxxxxxxxxxx>
Sent: Sunday, September 29, 2002 10:33 PM
Subject: [directmusic] Re: Mem usage


>
> Measuring memory usage from playing the music in-game (not in Producer).
> But I was only looking at the memory counts that Windows TaskManager
> provides (nothing very scientific -- though I made sure the game memory
> usage was stable before starting the music).  I was just trying to get
rough
> estimates for how much memory using DirectMusic was costing us -- to see
if
> it was worth worrying about or not.  My first assessment is that it very
> much is something that needs looking more deeply into.  I'm hoping I'm
just
> doing something stupidly wrong.  All the WVPs have the streaming check box
> checked, so I would expect it to be using much less than the total size of
> the source data, let alone over twice.  Is there an interface to get at
how
> much memory DirectMusic thinks it's using?  (it would be interesting to
> compare that to the numbers windows is reporting)
>
> I haven't tried setting the "don't pre-roll" flag yet as Scott suggested,
> I'll do that now.
>
>
> Aaron
>
> ----- Original Message -----
> From: "David Yackley" <davidy@xxxxxxxxxxxxx>
> To: <directmusic@xxxxxxxxxxxxx>
> Sent: Sunday, September 29, 2002 10:20 PM
> Subject: [directmusic] Re: Mem usage
>
>
> >
> > Aaron,=20
> > I couldn't tell from your post if you're measuring memory in Producer or
> > in runtime.  In Producer memory usage is going to be considerably
> > higher. =20
> > David Yackley (MS)
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> >
> > -----Original Message-----
> > From: Scott Morgan [mailto:scott@xxxxxxxxxxxxxxxxx]=20
> > Sent: Sunday, September 29, 2002 4:31 PM
> > To: directmusic@xxxxxxxxxxxxx
> > Subject: [directmusic] Re: Mem usage
> >
> >
> > Make sure the wave is set as a streaming wave.  It helps to check 'don't
> > pre-roll' also.
> >
> > The wave data will be uncompressed when it is loaded, but if its
> > streaming
> > it shouldn't be that big of a deal.  I notice about 1MB usage for one
> > streaming wave.
> >
> > An 11MB container shouldn't use 22 MB unless you have a a bunch of
> > buffers
> > in your audiopath and are using DMOs (especially mutiple reverbs and
> > sends).
> >
> > Hope that helps,
> >
> > -Scott Morgan
> > http://Morganstudios.com
> >
> >
> > ----- Original Message -----
> > From: "Aaron R Leiby" <aleiby@xxxxxxxxxxxxx>
> > To: <directmusic@xxxxxxxxxxxxx>
> > Sent: Sunday, September 29, 2002 5:58 PM
> > Subject: [directmusic] Mem usage
> >
> >
> > >
> > > 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: