Cache Variants

Use

The Cache Management Library provides several cache variants with different behavior based on several use-case criteria in order to satisfy the numerous types of cache users within the SAP landscape. The criteria are a combination of the cached objects type and the cached objects lifetime. The variants are summarized by the following table:

Variant

Object Type

Life Time

Local

Not sharable

Based on thresholds

Local Soft

Not sharable

Based on references, free memory and thresholds

Features

Each of the cache variants described below has different behavior in the sense of storing the cached objects and reacting to eviction invocations. The different behavior is provided by using different implementations of the storage plug-ins.

Cache Variant: Local

This variant imposes no restrictions on the cached objects. A local copy of each object is kept on each of the virtual machines. The lifetime of the objects is based on the cache thresholds configured.

As local copies of the cached objects are used in this variant, rewrite access frequency has no important implications.

This variant is implemented by the HashMapStorage storage plug-in.

Cache Variant: Local Soft

This variant is very close semantically to the previous one. The difference is that the storage plug-in does not keep a hard reference to the local copy of the object, but a soft one. Whenever a threshold is exceeded, the storage plug-in changes the soft reference to weak. This makes it possible to remove the object from the cache if no application has a reference to the object.

The same considerations for object type and rewrite access frequency as for the Local variant apply here too.

This variant is implemented by the SoftStorage storage plug-in.