commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@gmail.com>
Subject Re: [VOTE] Release BeanUtils 1.8.0 Beta (RC1)
Date Fri, 03 Aug 2007 01:50:23 GMT
On 8/2/07, Jörg Schaible <joerg.schaible@gmx.de> wrote:
> Hi Niall,
>
> I downloaded the source tar ball and build it from scratch with M2 on Linux
> using my compiler zoo.
>
> One note in advance: There's a lot of logging at the console along with
> quite some printed stack traces. However, for most of my JDK's (Blackdown
> 1.4.2.03, IDM JDK 1.4.2.9, JRockit 1.4.2.14, JRockit 1.5.0.11, Sun JDK
> 1.4.2.15, Sun JDK 1.5.0.12, Sun JDK 1.6.0.02) the test succeed with no
> problems.

Hi Jörg, first thanks for going to so much trouble in testing this on
all those JDKs - much appreciated.


> Not so for IMB JDK 1.5.0.5:
>
> -------------------------------------------------------------------------------
> Test set: org.apache.commons.beanutils.BeanificationTestCase
> -------------------------------------------------------------------------------
> Tests run: 8, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.25 sec <<<
> FAILURE!
> testMemoryLeak2(org.apache.commons.beanutils.BeanificationTestCase)  Time
> elapsed: 2.361 sec  <<< ERROR!
> java.lang.OutOfMemoryError
>         at org.apache.commons.beanutils.BeanificationTestCase.testMemoryLeak
> (BeanificationTestCase.java:171)
>         at org.apache.commons.beanutils.BeanificationTestCase.testMemoryLeak
> (BeanificationTestCase.java:171)
>
> [snip]
>
> -------------------------------------------------------------------------------
> Test set: org.apache.commons.beanutils.locale.LocaleBeanificationTestCase
> -------------------------------------------------------------------------------
> Tests run: 9, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.719 sec
> <<< FAILURE!
> testMemoryLeak
> (org.apache.commons.beanutils.locale.LocaleBeanificationTestCase)  Time
> elapsed: 2.48 sec  <<< ERROR!
> java.lang.OutOfMemoryError
>         at
> org.apache.commons.beanutils.locale.LocaleBeanificationTestCase.testMemoryLeak
> (LocaleBeanificationTestCase.java:182)
>         at
> org.apache.commons.beanutils.locale.LocaleBeanificationTestCase.testMemoryLeak
> (LocaleBeanificationTestCase.java:182)
>
>
> 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.

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

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.

Niall

> - Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message