Define Capacity

You can define a capacity for the space to control the amount of memory used by the seeders for storing tuples in the space. The capacity is expressed in number of tuples per seeder and defaults to -1, which means an infinite number of tuples per seeder.

If a capacity is specified, then you must specify an eviction policy that is used to indicate the outcome of an operation that would result in an additional tuple being seeded by a seeder that is already at capacity. The two choices for the eviction policy are NONE, which means that the operation will fail with the appropriate exception being stored in the Result object, or LRU, which means that the seeder will evict another tuple using the Least Recently Used (LRU) eviction algorithm, where the least recently read or modified tuple will be evicted from the space.

Specifying a capacity and an eviction policy of LRU for a space means that the space can effectively be used as a cache, and when used in conjunction with persistence, allows access to a persistent data-store in a “cache-through” mode of operation.

If you specify a capacity setting, then ActiveSpaces enforces the capacity limitation at one second intervals, and carries out any eviction policies that are configured.

When recovering a space which has capacity defined, by default only the keys and indexes of the space are restored to memory regardless of whether or not the capacity has been reached. When a capacity has been defined for a space, you can force the recovery of all data for a space, up to the capacity, by using the robust_load_only recovery policy of the Admin CLI command - recover metaspace or recover space <space_name>. For any other recovery policy setting, the default behavior of only loading keys and indexes to memory is enforced. For more detailed information on these commands, see the Admin CLI for Activespaces Administration section of the TIBCO ActiveSpaces Administration guide.
Note: When capacity is defined but the eviction policy is not set, if one of the seeders leaves the metaspace, the remaining seeders may hold the tuples for more than the specified capacity. This is an expected behavior of redistribution or re-replication. However, new PUT operations will fail if any of the seeders reaches the capacity.
Related reference