onbar backup and shared memory virtual segments

Engine adds shared memory virtual segments while onbar backup is running. After backup completes, segments can not be freed.

During an onbar backup process, the database engine may allocate additional shared memory virtual segments. After the backup operation completes, these virtual segments are observed not to be immediately released or freed, leading to an apparent increase in shared memory utilization. No warning or error messages show up in standard output or ON-Bar activity log indicating increase in the shared memory utilization.

This behavior, where shared memory virtual segments persist due to the caching of free mutex structures (enabled by default), is a common observation and is part of the system's design for performance optimization.

This memory will be fully released at the end of the archive process if the caching feature is disabled. However, if mutex caching is enabled (which is the default behavior), the cache can expand up to a relatively high per-VP (Virtual Processor) threshold. This means that shared memory usage might appear higher than expected, even after a backup completes, because the system is retaining these cached mutex structures for potential future use, thereby improving performance for subsequent operations.

To stabilize shared memory usage and to ensure that virtual segments are freed regardless of the number of onbar -b executions, follow these steps:

  1. Disable mutex caching: Set the VP_MAX_FREE_MUTEX_LIST configuration parameter to 0 in your database server's configuration file (i.e. onconfig file) before initiating your testing or production backups.

    VP_MAX_FREE_MUTEX_LIST 0
    Note: Setting this to 0 disables the caching of free mutex structures, ensuring that shared memory used by these structures is released more promptly.
  2. Drain memory pools: After each archive operation (i.e., after each onbar -b execution), execute the onmode -F command. This command helps to drain various memory pools (such as mt, rsam, and other internal pools), facilitating the release of shared memory.

    onmode -F

By implementing these two steps, shared memory usage can be effectivitely managed and stabilized, ensuring that virtual segments are released after onbar backups.