[id='custom_class_eviction-{context}']
= Custom Classes with Memory-Based Eviction
You must use binary or off-heap storage memory based eviction,
as in the following examples:

.Declarative configuration
[source,xml,options="nowrap",subs=attributes+]
----
include::config_examples/config_eviction_memory.xml[]
----

.Programmatic configuration
[source,java]
----
include::code_examples/ConfigEvictionMemory.java[]
----
