incubator-directmemory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raffaele P. Guidi" <raffaele.p.gu...@gmail.com>
Subject Re: Questions about collectExpired
Date Tue, 29 May 2012 08:22:55 GMT
Ok, got it: absolute means an absolute date and time for expiration (i.e.
valid until midnight, may, 5, 2012), where relative means that the item is
valid for i.e. 5 minutes since its creation

On Tue, May 29, 2012 at 10:02 AM, Jeff MAURY <jeffmaury@jeffmaury.com>wrote:

> Hi,
>
> I you look at the code of the collectExpired in MemoryManagerServiceImpl:
>
>   @Override
>    public long collectExpired()
>    {
>        int limit = 50;
>        return free( limit( filter( pointers, relative ), limit ) )
>                        + free( limit( filter( pointers, absolute ), limit
> ) );
>
>    }
>
> where relate and absolute are 2 Predicate fields but with the same
> definition.
> The rationale is that this will cause up to 100 pointers to be freed but
> most important, what's the semantic of absolute and relative ?
>
> Thanks
> Jeff
>
>
> On Tue, May 29, 2012 at 7:43 AM, Raffaele P. Guidi <
> raffaele.p.guidi@gmail.com> wrote:
>
> > Uhm, if the filter is wrong it's probably my fault but I don't get
> exactly
> > what you mean with "relative and absolute". The 50 limit was to keep the
> > collect operation light and unobtrusive.
> >
> > Ciao,
> >    R
> >
> > On Tue, May 29, 2012 at 12:54 AM, Jeff MAURY <jeffmaury@jeffmaury.com
> > >wrote:
> >
> > > Hello,
> > >
> > > I am working on getting the code coverage better than it is today and I
> > > looked at the collectExpired in MemoryManagerServiceImpl and I have the
> > > following questions:
> > >
> > > 1) it limits the number of pointers to be freed to 50, no problem, but
> > what
> > > is the rationale of calling free twice using the same predicates
> relative
> > > and absolute (they are the same): I don't get the exact semantic of
> those
> > > two predicates. Can someone help me. BTW, those 2 predicates are buggy
> > > because they filter pointers based on fact that they are not free (OK)
> > and
> > > not expired !!! (KO). I will open a JIRA but I need to understand the
> > > semantic better in order to submit a patch.
> > >
> > > Thanks
> > >
> > > --
> > > Jeff MAURY
> > >
> > >
> > > "Legacy code" often differs from its suggested alternative by actually
> > > working and scaling.
> > >  - Bjarne Stroustrup
> > >
> > > http://www.jeffmaury.com
> > > http://riadiscuss.jeffmaury.com
> > > http://www.twitter.com/jeffmaury
> > >
> >
>
>
>
> --
> Jeff MAURY
>
>
> "Legacy code" often differs from its suggested alternative by actually
> working and scaling.
>  - Bjarne Stroustrup
>
> http://www.jeffmaury.com
> http://riadiscuss.jeffmaury.com
> http://www.twitter.com/jeffmaury
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message