UtilCacheTests sporadic failure

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

UtilCacheTests sporadic failure

Adam Heath-2
Well, good news.  I just had UtilCacheTests.testExpire fail on me.
Since I'm the one who created that test, I'm the most qualified to fix it.

Unfortunately, the test itself attempts to use all memory, so that
UtilCache will attempt to expire all soft references.  Sometimes, that
doesn't work.  I might have to do something hackish, by seeing how
much total memory is available, allocating 40% of that into a
soft-reference cache, then multiple objects of 15%, stored
locally(there-by they are hard-references), then seeing if that clears
the item.  But it's all still a bit racy.
Reply | Threaded
Open this post in threaded view
|

Re: UtilCacheTests sporadic failure

Adrian Crum-3
It would be nice if you could specify a cache capacity - so you could
test the cache with a smaller data set.

-Adrian

On 5/14/2012 8:22 PM, Adam Heath wrote:

> Well, good news.  I just had UtilCacheTests.testExpire fail on me.
> Since I'm the one who created that test, I'm the most qualified to fix it.
>
> Unfortunately, the test itself attempts to use all memory, so that
> UtilCache will attempt to expire all soft references.  Sometimes, that
> doesn't work.  I might have to do something hackish, by seeing how
> much total memory is available, allocating 40% of that into a
> soft-reference cache, then multiple objects of 15%, stored
> locally(there-by they are hard-references), then seeing if that clears
> the item.  But it's all still a bit racy.
Reply | Threaded
Open this post in threaded view
|

Re: UtilCacheTests sporadic failure

Adam Heath-2
On 05/14/2012 02:26 PM, Adrian Crum wrote:
> It would be nice if you could specify a cache capacity - so you could
> test the cache with a smaller data set.

I'm already using a size of '5' and '1' in that test.
Reply | Threaded
Open this post in threaded view
|

Re: UtilCacheTests sporadic failure

Adrian Crum-3
On 5/14/2012 8:29 PM, Adam Heath wrote:
> On 05/14/2012 02:26 PM, Adrian Crum wrote:
>> It would be nice if you could specify a cache capacity - so you could
>> test the cache with a smaller data set.
> I'm already using a size of '5' and '1' in that test.

You were right - you are the most qualified to fix it. ;)

-Adrian
Reply | Threaded
Open this post in threaded view
|

Re: UtilCacheTests sporadic failure

Adrian Crum-3
In reply to this post by Adam Heath-2
I wonder how that affects virtual memory. I have 4GB RAM plus 4GB
virtual memory (swap space).

-Adrian

On 5/14/2012 8:22 PM, Adam Heath wrote:

> Well, good news.  I just had UtilCacheTests.testExpire fail on me.
> Since I'm the one who created that test, I'm the most qualified to fix it.
>
> Unfortunately, the test itself attempts to use all memory, so that
> UtilCache will attempt to expire all soft references.  Sometimes, that
> doesn't work.  I might have to do something hackish, by seeing how
> much total memory is available, allocating 40% of that into a
> soft-reference cache, then multiple objects of 15%, stored
> locally(there-by they are hard-references), then seeing if that clears
> the item.  But it's all still a bit racy.