Subversion
------------------------------------------------------------
URL: http://svn.apache.org/repos/asf/ibatis/java/ibatis-3/trunk
Revision: 893634
Last Changed Author: cbegin
Last Changed Rev: 893558
Last Changed Date: 2009-12-23 09:01:16 -0700 (Wed, 23 Dec 2009)
------------------------------------------------------------

Java
------------------------------------------------------------
java version "1.6.0_15"
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02, mixed mode)
-vmargs -Xms256m -Xmx2048m -XX:MaxPermSize=512m
------------------------------------------------------------

OS
------------------------------------------------------------
Linux host 2.6.31-16-generic #53-Ubuntu SMP Tue Dec 8 04:02:15 UTC 2009
x86_64 GNU/Linux
(Ubuntu 9.10 64-bit)
------------------------------------------------------------


nmaves wrote:
> 
> Dan,
> 
> What release did you check out?  What does your env look like?  OS?
> Java version?
> 
> I have not seen a test failing in any of the beta builds.
> 
> Nathan
> 
> On Wed, Dec 23, 2009 at 11:30 AM, Dan Forward
> <dan-nab...@forwardhome.com> wrote:
>>
>> I just checked out the latest code for iBATIS 3 and discovered that a
>> unit
>> test fails while building.
>>
>> ------------------------------------------------------------
>> Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 5.006 sec
>> <<< FAILURE!
>> shouldDemonstrateObjectsBeingCollectedAsNeeded(org.apache.ibatis.cache.SoftCacheTest)
>> Time elapsed: 4.96 sec  <<< FAILURE!
>> java.lang.AssertionError:
>>        at org.junit.Assert.fail(Assert.java:71)
>>        at org.junit.Assert.assertTrue(Assert.java:34)
>>        at org.junit.Assert.assertTrue(Assert.java:43)
>>        at
>> org.apache.ibatis.cache.SoftCacheTest.shouldDemonstrateObjectsBeingCollectedAsNeeded(SoftCacheTest.java:21)
>> ------------------------------------------------------------
>>
>> It seems that this test attempts to fill the cache beyond the limits of
>> available memory, then checks whether the size of the cache is smaller
>> than
>> the number of items added. The cache is filled with 300,000 byte arrays
>> that
>> are 5001 bytes in size.
>>
>> I set the limit to 3,000,000 and told the loop to break as soon as the
>> size
>> of the cache was less than the number entered, and discovered that it
>> happened after 326,315 entries and approximately 6 seconds on my machine.
>> The test I used is below.
>>
>> @Test
>> public void shouldDemonstrateObjectsBeingCollectedAsNeeded() throws
>> Exception {
>>        final int N = 3000000;
>>        SoftCache cache = new SoftCache(new PerpetualCache("default"));
>>        for (int i = 0; i < N; i++) {
>>          byte[] array = new byte[5001]; //waste a bunch of memory
>>          array[5000] = 1;
>>          cache.putObject(i, array);
>>          Object value = cache.getObject(i);
>>          if (cache.getSize() < i + 1) {
>>                  System.out.println("Cache exceeded with " + (i + 1) + "
>> entries.");
>>                  break;
>>          }
>>        }
>>        assertTrue(cache.getSize() < N);
>> }
>>
>> --
>> View this message in context:
>> http://old.nabble.com/SoftCacheTest-is-Failing-tp26905687p26905687.html
>> Sent from the iBATIS - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscr...@ibatis.apache.org
>> For additional commands, e-mail: dev-h...@ibatis.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@ibatis.apache.org
> For additional commands, e-mail: dev-h...@ibatis.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/SoftCacheTest-is-Failing-tp26905687p26909258.html
Sent from the iBATIS - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ibatis.apache.org
For additional commands, e-mail: dev-h...@ibatis.apache.org

Reply via email to