Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 737483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:43:35+00:00 2026-05-14T07:43:35+00:00

I’m trying to create a jboss-cache for data that is only relevant for a

  • 0

I’m trying to create a jboss-cache for data that is only relevant for a short period of time. After that time the data should be discarded and the respective memory freed.

The cache is organized like this:

/my_region
    /session_1
        /datanode_1
          attribute1: value1
        /datanode_2
          attribute2: value2
    /session_2
        ...
    /session_3
        ...
    ...
    ...

And my eviction policy configuration looks like this:

<attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute> 
<attribute name="EvictionPolicyConfig">
   <config>
      <attribute name="wakeUpIntervalSeconds">5</attribute>     
         <region name="/my_region">
     <attribute name="maxNodes">100</attribute>
     <attribute name="timeToLiveSeconds">1800</attribute>
        </region>
   </config>
</attribute>

This works: when /my_region gets more than 100 children, the least recently used children are evicted so that the region shrinks back to 100 children.

The problem with the LRUPolicy is that when the evicted nodes have children, they’re not completely removed, but marked with jboss:internal:uninitialized: null instead. This behaviour makes sense for entities that are cached to avoid fetching them from a persistent storage, but it is not suitable for caching entities that are not persisted and will never be accessed again.

So, to remove the nodes, I’ve created an extension of LRUPolicy that overrides evict with remove.

@Override
public void evict(Fqn fqn) throws Exception {
    cache_.remove(fqn);
}

This new policy does not leave joss:internal:uninitialized: null‘s behind, but it removes the /my_region node when maxNodes is reached. When I put the LRUPolicy back, I noticed that the region node itself actually gets evicted and gets the unitialized tag, but the 100 most recently used children still remain.

How can I prevent the region itself from being evicted? Is there some better way to do the removal instead of eviction without separating the eviction from expiration?

I’m using jboss-cache version 1.3.0.SP4.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:43:36+00:00Added an answer on May 14, 2026 at 7:43 am

    Did you look in the JBoss-Cache bugs repository?


    Edit:

    Take a look at this JBoss-Cache bug, it seems quite relevant:

    https://jira.jboss.org/jira/browse/JBCACHE-921

    Fixed in 1.4.1.SP1

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 398k
  • Answers 398k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer do you mean U.S. Postal Service? it is in the… May 15, 2026 at 3:42 am
  • Editorial Team
    Editorial Team added an answer For array keys, the dictionary willuse the references for hashing… May 15, 2026 at 3:42 am
  • Editorial Team
    Editorial Team added an answer As was mentioned by David, this is a very hard… May 15, 2026 at 3:42 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.