hi,
I recently read the directmemroy's souce code and found
org.apache.directmemory.memory.AbstractMemoryManager#collectExpired is
implement like this:
public long collectExpired()
{
int limit = 50;
return free( limit( filter( pointers, relative ), limit ) )
+ free( limit( filter( pointers, absolute ), limit ) );
}
but the "relative" and "absolute" are the same!
final Predicate<Pointer<V>> relative = new Predicate<Pointer<V>>()
{
@Override
public boolean apply( Pointer<V> input )
{
return !input.isFree() && input.isExpired();
}
};
final Predicate<Pointer<V>> absolute = new Predicate<Pointer<V>>()
{
@Override
public boolean apply( Pointer<V> input )
{
return !input.isFree() && input.isExpired();
}
};
why? why are they same? why free two times "!input.isFree() &&
input.isExpired()"?
------------------
Best Regards!