Audiokinetic Wwise Knowledge Base

Determining an Appropriate Size for Your Memory Pools

The default size of the internal memory pools of the sound engine are very large only to ensure that anyone who tries the sound engine for the first time has enough resources to run their worst-case scenario.

The default size for each pool is actually:

  • 16 MB for the default memory pool (in AkInitSettings structure)
  • 16 MB for the lower engine memory pool (in AkPlatformInitSettings structure)

Note: If you use the sample code to integrate the streaming manager, 8 MB are also allocated for the streaming buffers (Stream I/O).

The two default memory pools have different uses.

Default Memory Pool: a general usage pool for high-level sound structures. This pool mostly contains the following:

  • Audio structural content.
  • Small size allocations for game objects, game object positions, listeners, RTPCs, switches, states, and so on.

Lower Engine Memory Pool: the main audio processing pipeline pool.It is generally used for audio playback, audio processing, memory allocated for effects, and so on.

The size of the default memory pool will ultimately depend on the type of game you are creating. For example, if your game has gigabytes of audio assets, but rarely plays more than four or five sounds at a time, with no or few effects, then the memory requirements of the default memory pool may be larger, but the requirements of the lower engine memory pool may be smaller. If, on the other hand, your game has few sounds, but plays them all simultaneously with lots of reverb, echo, and other environmental effects, like in a first-person shooter, then the memory requirements of the default memory pool may be smaller, but the requirements of the lower engine memory pool may be larger.

The size of the lower engine memory pool will ultimately depend on what you plan to do with the sound engine. If your game will play a lot of voices simultaneously (including virtual voices), and will be processing a large number of effects, then you will need more memory in this pool.

Setting the Size of Your Memory Pools

On the PC, with no banks loaded or sounds playing, the amount of memory used should be around 150kB.You can see the exact amount in Wwise, by switching to the Profiler layout and looking at the Total Used Memory value in the Performance Monitor. This value will obviously go up with the number of assets loaded, voices playing, game object positions, and so on.

The required size of your memory pools will depend on a number of different factors, including the quality of your audio, the number of sounds loaded, the number of voices playing simultaneously, the complexity of your sound structures, the encoding method chosen, the type and number of effects that require processing, the number of 3D positioned sounds, switches, and so on.

The only reliable way to know how much memory is required is to do the following:

  1. Assign an arbitrary amount of memory to the pools. If you can, start by using the default memory sizes.
  2. Connect Wwise to your game.
  3. Run a busy game scenario with the Profile version of the sound engine.
  4. Look at the Memory tab of the Advance Profiler.The Peak Used column should give you a good indication of what the pool sizes should be. Typically, the optimal size for each pool is 15-20% above the peak memory usage value.

Debug-only allocations are made in the Communications, Monitor, and Monitor Queue memory pools, which are not created in the Release version. Subtracting the size of these pools should give you a good idea of the release-version memory usage.

Note: You can also explore sound engine memory usage in the Memory tab by capturing profile information from Wwise itself without connecting to a game.

What Size Should I Use to Get Started?

In most cases, it is best to start off using the default memory pool sizes (16 MB per pool). By having such large pool sizes, you can easily find out what your real memory usage is and then you can trim down the pools accordingly. If you are more restricted to the amount of memory you can assign to these pools (16 MB is too much), you can start by using the following values:

  • Default memory pool               : 2MB
  • Lower engine memory pool      : 2MB
  • Streaming management           : 2MB

2MB per pool should be enough to cover most, if not all, of your scenarios. The streaming buffer size will depend on if you plan to stream a lot of sounds, the quality of the sounds, and the safety timeline of the streaming sounds. The default value of 8MB would generally be seen as a waste of memory for most games, but again it is best to start out large and trim down as your memory usage becomes clearer.

For more information about setting the size of your memory pools, refer to the section Going Further > Optimizing Memory Pools in the SDK.

For more information on the streaming buffer memory, refer to the section
"Going Further > Overriding Managers > Streaming/Stream Manager > High-Level Stream Manager API description > Audiokinetic Stream Manager Initialization Settings" in the SDK Help.

Memory Pool Sizes and Platforms

When setting the pool size for each platform, it is important to understand that the size of a memory pool depends much more on audio content and usage than it does on the platform. This means that, you can use the same pool sizes to start with and then tailor them to the particular platform using the memory readings in the Profiler. The exception to this would be the lower engine memory pool on the Wii, which requires much less memory than the other platforms due to the fact that it has no software mixing buffers. In this case, a value of 1MB for the lower engine memory pool would be a good starting point.




Article Details

Last Updated
17th o March, 2009

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF

User Opinions (1 vote)

100% thumbs up 0% thumbs down

How would you rate this answer?



Thank you for rating this answer.

Related Articles

No related articles were found.

Attachments

No attachments were found.

Continue