Ce contenu n'est pas disponible dans la langue sélectionnée.

4.5. Configure Expiration


In Red Hat JBoss Data Grid, expiration is configured in a manner similar to eviction, with differing parameters for Library Mode and Remote Client-Server Mode.

Procedure 4.1. Configure Expiration in Library Mode

  1. Add the Expiration Tag

    Add the <expiration> tag to your project's <cache> tags as follows:
    <expiration />
    Copy to Clipboard Toggle word wrap
  2. Set the Expiration Lifespan

    Set the lifespan value to set the period of time (in milliseconds) an entry can remain in memory. The following is an example of this step:
    <expiration lifespan="1000" />
    Copy to Clipboard Toggle word wrap
  3. Set the Maximum Idle Time

    Set the time that entries are allowed to remain idle (unused) after which they are removed (in milliseconds). The default value is -1 for unlimited time.
    <expiration lifespan="1000" maxIdle="1000" />
    Copy to Clipboard Toggle word wrap
  4. Set the Background Reaper Thread

    Enable or disable the background reaper thread to test entries for expiration. Regardless of whether a reaper is used, entries are tested for expiration lazily when they are touched. The default value is true.
    <expiration lifespan="1000" maxIdle="1000" reaperEnabled="true" />
    Copy to Clipboard Toggle word wrap
  5. Set the Expiration Interval

    Set the interval (in milliseconds) between subsequent runs to purge expired entries from memory and any associated cache stores. To disable the periodic eviction process set the interval to -1. The default value is 1000.
    <expiration lifespan="1000" maxIdle="1000" reaperEnabled="true" wakeUpInterval="5000" />
    Copy to Clipboard Toggle word wrap

Procedure 4.2. Configuration Expiration in Remote Client-Server Mode

  1. Set the Expiration Lifespan

    Set the lifespan value to set the period of time (in milliseconds) an entry can remain in memory. The following is an example of this step:
    <expiration lifespan="1000" />
    Copy to Clipboard Toggle word wrap
  2. Set the Maximum Idle Time

    Set the time that entries are allowed to remain idle (unused) after which they are removed (in milliseconds). The default value is -1 for unlimited time.
    <expiration lifespan="1000" max-idle="1000" />
    Copy to Clipboard Toggle word wrap
  3. Set the Expiration Interval

    Set the interval (in milliseconds) between subsequent runs to purge expired entries from memory and any associated cache stores. To disable the periodic eviction process set the interval to -1. The default value is 5000.
    <expiration lifespan="1000" max-idle="1000" interval="10000" />
    Copy to Clipboard Toggle word wrap
  4. Reaper Thread in Remote Client-Server Mode

    In Remote Client-Server Mode the background reaper thread is only enabled if interval is greater than 0. As interval defaults to 5000 the background reaper thread is automatically enabled if expiration is configured.
Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat