Memory Reserve for Persistence Services
Memory reserve is pre-allocated memory with which a persistence service could continue limited operations after exhausting available memory.
Caveat
For best results, avoid exhausting available memory. Techniques include pre-production resource allocation testing and appropriate configuration of the persistence store’s byte limit parameter.
Memory reserve does not guarantee continued operation, merely a best effort attempt. For example, other processes could interfere with memory reserve operation.
Background Information
Stored messages occupy process memory within a persistence service. As a persistence service accumulates message data from publishers, it allocates memory. As clients consume stored messages, the persistence service reclaims their memory.
If the operating system denies a request to allocate memory, the persistence service must discontinue normal operation. However, the persistence service can continue partial service using its memory reserve.
Behavior
- Message data growth exhausts available memory on the persistence service host computer.
Such growth could indicate that subscribing clients are operating slowly, or not operating at all. Alternatively, the issue could result from high demand for memory by another process on the persistence service host computer.
- The persistence service rejects all new inbound data messages from publishing clients.
- Meanwhile, the persistence service attempts to use memory from the reserve for limited operation, for example, to continue replication, and to service data requests and acknowledgements from subscribing clients.
- The demand for memory subsides.
- When the persistence service can reallocate its full memory reserve, it resumes accepting and storing new messages from publishing clients.
Size
Administrators can specify the memory reserve using the configuration file parameter mem-reserve.
As a rule of thumb, reserve an additional 10% of the maximum expected volume of stored message data. For best results, test persistence service behavior in a pre-production environment, and adjust the size of the memory reserve accordingly.