Memory Consumption Control

To reduce memory consumption in HVAR, control the size of compilable groups.

Memory consumption refers to Replication Server data structures such as the net-change database, and the data that the structures store. Net-change databases are in-memory data structures. Net-change database memory consumption can increase drastically when Replication Server compiles commands applied on a table with a large number of columns, or tables with large text and image datatype values. For example, compiling 1,000,000 rows in a table with 100 columns may consume approximately 10 times more memory than compiling the same number of rows in a table with 10 columns. Replication performance suffers when there is insufficient memory available for other processes and modules.

Replication Server marks a transaction as noncompilable if the transaction is larger than the DSI SQT cache size. If a transaction can fit into the DSI SQT cache, Replication Server checks the size of the transaction against the values of dsi_cdb_max_size and dsi_compile_max_cmds. Replication Server marks the transaction as noncompilable if Replication Server estimates that the size of the net-change database the transaction requires is larger than dsi_cdb_max_size, or if the transaction contains more commands than dsi_compile_max_cmds. Replication Server applies this large noncompilable transaction in the continuous replication mode. Using the continuous replication mode avoids generating a single large net-change database to accommodate the large transaction and reduces memory consumption.

Replication Server tries to group as many compilable transactions as possible into a compilable group. Replication Server also uses dsi_cdb_max_size and dsi_compile_max_cmds as thresholds for the size of compilable groups. Once a group reaches either the size you set in dsi_cdb_max_size or dsi_compile_max_cmds, Replication Server stops compiling transactions into the group and applies each compilable group as a single transaction to the replicate database.