Hi Niall,

Niall Pemberton wrote on Friday, August 03, 2007 3:52 AM:

[snip]

>>> Since the test implies some nasty error condition (I did not have a
>>> look at the code yet), it might simply reveal some error of the JDK
>>> (especially since IBM JDK 1.4.2 works) ...
>> 
>> BeanUtils has "per ClassLoader" caches
> (ContextClassLoaderLocal) which
>> uses a WeakHashMap to store references to each ClassLoader's cache.
>> The Beanification tests failing are basically trying to force garbage
>> collection by allocating ever increasing amounts (to the power of 2)
>> of spurious memory and calling System.gc() - to verify that these
>> references are released. 

Hehehe. Just by looking at the name of the test, I had something like this in 
my mind.
 
>> Personally I think the test is flawed - iterating around allocating
>> an array, doubling in size each time - since by the 20th iteration
>> its allocating 1MB and by the 30th iteration 1GB. Clearly in this
>> case it blew the memory first - but I don't think that really proves
>> anything since theres  no way of knowing whether the JVM either:
>>  - couldn't garbage collect the reference for some reason (aim of
>> the test) 
>>  - didn't try to garbage collect before running out of memory

Yep. Some alternate strategies for this would be good.

>> Since it is woking on other JDKs then (i.e. seems to be forcing
>> garbage collection of those weak references) then I think its not a
>> big issue. We should probably look at improving the test - but I'm
>> not sure how - on the Sun JDK 1.5 its only allocating a few bytes (1
>> or 2 iterations) before the garnage collector runs.
> 
> btw this behaviour (and test) is pretty much unchanged since the
> 1.7.0 release. 

I bet, noone tried to run the tests on all those JDK's ... ;-)

However, I also don't think this problem is something that should prevent the 
release.

So +1 from me.

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to