Accessing shared memory details
When you configure a host to run more than one recognition service, the Recognizer optimizes system capacity by automatically creating a shared-memory region. The recognition service instances on a host use this region to share resources like acoustic models.
Shared memory is enabled by default for any role running multiple recognition service instances. Do not disable it. It is disabled for roles running a single recognition service because it isn’t needed.
Viewing shared memory details
To access this information:
- Select a host and click the Shared Memory Details link (Monitoring & Control→System Control→Vital Signs).
For example:
Note: This feature is not available for roles running a single recognition service instance.
The relevant details are:
- Shared Memory Status region—Amount of shared memory currently used / amount of allocated shared memory.
- Shared Memory Total Size—Amount of memory available for resource sharing by all recognition service instances on this host. The default, in bytes, is 4294967296 (4 GB). Configurable with the swirec_shmem_size parameter, discussed below.
- Shared Memory Allocatable Size—Amount of memory actually reserved for resource sharing. It is smaller that the total since the Recognizer sets aside a small region to manage shared memory.
- Allocated (total)—Amount of memory currently used by the recognition service instances.
- Free (total): Remaining amount of reserved shared memory available for use. Free (total) + Allocated (total) = Shared Memory Allocatable Size.
- The other fields are generally only of interest to Nuance.
- Click Save to save the information to a text file in a location of your choice.
Configuring shared memory parameters
If necessary, you can configure these shared memory parameters:
- swirec_shmem_size—Specifies the total amount of shared memory. The default is 4294967296 bytes (4 GB). Note that the more shared memory you reserve, the less memory there is available for other purposes. You need to take into account the physical limits of the machine and the need to leave sufficient amounts of non-shared memory available.
- swirec_shmem_warn_threshold—Specifies the threshold as a percentage of shared-memory usage. When the threshold is surpassed, each recognition service instance generates an minor alarm warning that the region is getting full. The threshold is automatically reset once the memory usage drops 10% below the threshold. If the threshold is exceeded again, a new set of alarms is generated. The default is 90 (percent).
To specify different values for these parameters, you must add them to the User-NRS0num.xml files located under %SWISRSDK%\config. %SWISRSDK% is the location of the Recognizer component. The num value refers to the particular recognition service instance. The value must be the same across all instances.

For example, if you are running four recognition service instances on a host and want to increase the shared memory size to 8 GB (8589934592 bytes), add swirec_shmem_size to User-NRS01.xml, User-NRS02.xml, User-NRS03.xml, and User-NRS04.xml. The syntax is:
<param name="swirec_shmem_size">
<value>8589934592</value>
</param>
To change the warning threshold to 80%, add this to each file:
param name="swirec_shmem_warn_threshold">
<value>80</value>
</param>

You must clean the shared-memory region if all instances of the recognition service exit abnormally. (For example, if there is a system crash or if an operator Aborts All.) If you don't clean the region, Linux will not automatically reclaim this space.
Run the cleanup utility, nr_shm, stored in %SWISRSDK%\amd64\bin. For example:
nr_shm -cleanup
Note: Don’t use this utility if any recognition service instances are still running. They can still access the shared-memory region.