[infinispan-dev] strictly not returning expired values

Elias Ross genman at noderunner.net
Tue Oct 18 13:45:22 EDT 2011


On Tue, Oct 18, 2011 at 10:13 AM, Mircea Markus <mircea.markus at jboss.com> wrote:

> The way I see it a user might configure an expiry for two reasons:
> - to manage memory
>  and/or
> - to control how much "staleness" the data it uses might have

I've mostly used expiry to control data staleness. For example, I
would hold a token for security validation. It wasn't entirely
necessary to have a high degree of accuracy, maybe an order of a few
seconds. But in many cases if the expiry thread runs every minute I
suspect this would be too long.

In my original implementation of expiration for JBoss TreeCache I used
a heap (priority queue) to order entries. This kept the implementation
very fast, at the expense of memory usage of course.

I agree that doing removals during data access is a very bad idea.

I would suggest having two user options: 1) Infrequent expiration
scans 2) Or, use of a priority queue and more frequent scanning.



More information about the infinispan-dev mailing list