You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directmemory.apache.org by Ashish <pa...@gmail.com> on 2011/10/17 08:04:18 UTC

Eviction issue

Folks,

This is a query regarding the Eviction. Scenario is

Add entries to offheap without expiry aka 0
Let the schedulesdisposal run after 10 sec
Access the key

It returns null :(

I tried to dig a bit deeper into and found that collectExpired() &
collectLFU() are executed during schedules cleanup, and collectLFU was
causing the entry to be freed, though it has not expired.

IMHO, we should call collectLFU() under resource constraints, like we
are short on space for entries, then we should evict LFU, wdyt?

-- 
thanks
ashish

Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal

Re: Eviction issue

Posted by Ashish <pa...@gmail.com>.
On Mon, Oct 17, 2011 at 12:05 PM, Raffaele P. Guidi
<ra...@gmail.com> wrote:
> Well of course it there was room for other entries it is a bug (my fault).
> Disposal functions should return without doing nothing if conditions do not
> apply

ok, actually caught this accidentally when I was trying to refine the
usage example.

This means that expiry of elements is also not working. For the API

put(String key, Object object, int expiresIn)

the value "expiresIn" is not passed to the putByteArray() API, and its
internally passing 0.

Shall raise a JIRA for this.

thanks
ashish

Re: Eviction issue

Posted by "Raffaele P. Guidi" <ra...@gmail.com>.
Well of course it there was room for other entries it is a bug (my fault).
Disposal functions should return without doing nothing if conditions do not
apply

On Monday, October 17, 2011, Ashish <pa...@gmail.com> wrote:
> Folks,
>
> This is a query regarding the Eviction. Scenario is
>
> Add entries to offheap without expiry aka 0
> Let the schedulesdisposal run after 10 sec
> Access the key
>
> It returns null :(
>
> I tried to dig a bit deeper into and found that collectExpired() &
> collectLFU() are executed during schedules cleanup, and collectLFU was
> causing the entry to be freed, though it has not expired.
>
> IMHO, we should call collectLFU() under resource constraints, like we
> are short on space for entries, then we should evict LFU, wdyt?
>
> --
> thanks
> ashish
>
> Blog: http://www.ashishpaliwal.com/blog
> My Photo Galleries: http://www.pbase.com/ashishpaliwal
>