Tuning Memory by Creating a Dedicated Engine Configuration

Tuning Memory by Creating a Dedicated Engine Configuration

In a multi-application environment, creating a custom engine configuration can be one way to optimize how Speech Engine Services (SES) allocates memory. Consider creating a new engine configuration to:

  • Distribute resource load to reduce overall memory consumption.

  • Balance resource usage when one application has significantly larger resources than the others.

  • Support a Multi-Language Application.

This topic discusses each of these scenarios in detail.

Distributing Resource Load

By default, SES preloads all application resources (as specified in the application manifest files) into all available engine instances at startup. This prepares any available engine instance to service any application as calls come in.

While loading resources into the default engine configurations is the simplest way to manage application resources, it might not always prove optimal. (See About Engine Configurations.)

To illustrate how distributing resource load can provide gains in memory consumption, consider the following:

  • Application A and B each use a 50 kb grammar file.

  • Loading these grammar files into the default engine configuration (24 recognition engine instances, or TelephonyRecognizers), consumes 1.2 mg of memory.

    This effectively provides only 12 recognizers for each application, as they share the pool of recognizers.

  • Creating a dedicated engine configuration for each application, with 15 recognizers each, consumes only 750 kb of memory, and actually increases the number of available recognition engines for each application.

Balancing Resource Usage

When the] resources for one application are notably larger than those for any other application, it may make sense to dedicate an engine configuration to handling the larger resources.

To ilustrate This scenario, consider the following:

  • Application A is the Logon application that supports Application B. Users generally access Application A only once, to create their account.

  • Application B is used more frequently than Application A, and contains much larger resources.

  • Preloading the resources for Application A into all available engine instances consumes a considerable amount of system memory, and may actually impact performance.

  • Creating an engine configuration solely to support Application A, with fewer initial engine instances, can significantly reduce system memory consumption. The Default engine configuration can easily handle Application B.

In this scenario, anticipated call volume must also be taken into account, so the number of available engines are sufficient to service Application A.

Supporting a Multi-Language Application

In any application, the resources being loaded into SES engines must match the language that engine supports. In a multi-language application, therefore, separate engine configurations must exist for each language the application supports.

When you install a language pack, additional default engine configurations are created to support applications written for that language. Initially, the non-English engine configurations specify zero engine instances. At a minimum, the number of instances must be set to reflect the application requirements.

To support a multi-language application, you may also want to consider defining unique configurations for each of the language-specific resources that the application uses. This is similar to the scenario described in the previous section, "Distributing Resource Load."

See Also

About Engine Configurations | Overview: SES Memory Usage | Tuning Engine Instances to Lower Memory Usage | Configuring Support for Additional Languages