StateCacheSizing

How much each context's state cache keeps when the host does not bound it by a number of states (wow.state-cache.capacity): a HEAP_SHARE of the JVM's maximum heap, split between the node's contexts, in the estimated bytes of the states it holds. A cached state is the aggregate's state object with its metadata, estimated at CachedState.STATE_BYTES, and its recent requests, whose rings grow with the requests the aggregate committed: most aggregates commit few, so the bytes hold far more of them than a count sized for full rings would. A domain whose states are much larger than the estimate sets the capacity itself.

The budget is at least MIN states with full rings, the former fixed default.

Properties

Link copied to clipboard
const val HEAP_SHARE: Double = 0.1

The share of the maximum heap the state caches of a node take together.

Link copied to clipboard
const val MIN: Int

The fewest states with full rings a context's cache holds when bounded by bytes.

Functions

Link copied to clipboard
fun entryBytes(recentRequests: Int): Long

The estimated bytes of one cached state whose rings hold recentRequests requests.

Link copied to clipboard
fun maxBytes(contexts: Int, recentRequests: Int, maxHeap: Long = Runtime.getRuntime().maxMemory()): Long

The estimated bytes each of contexts state caches holds on a heap of at most maxHeap bytes, each state keeping up to recentRequests recent requests.