To improve performance OnixS::B3::MarketData::UMDF::OrderBook instance keeps some of its internals in the preallocated memory areas (chunks).
The chunks are initially owned by the OnixS::B3::MarketData::UMDF::OrderBookPool object. The OrderBookPool
object is shared between the OrderBook
s (and can be shared between several instances of the handlers).
When a chunk is taken from the pool, it is not shared between the other order books, so the number of the chunks must be at least equal to the number of order books. A single order book can use from 1 to 255 chunks if necessary.
The number of books equals the number of securities on a channel or the size of the security filter (if used).
Placing the order book's internals into a single chunk improves data locality and can thus improve performance, so the chunk must be sufficient to fit the book content. On the other hand, making a chunk too big can lead to excessive memory consumption.
If the amount of preallocated objects specified by OnixS::B3::MarketData::UMDF::OrderBookPoolSettings is not enough to manage order books, the pool will allocate more using OnixS::B3::MarketData::UMDF::OrderBookPoolSettings::growthPolicy.