You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "kuldeepak bajaj (JIRA)" <ji...@apache.org> on 2014/09/15 10:32:33 UTC

[jira] [Created] (BEANUTILS-466) Threads are blocked while creating LazyDynaBean objects.

kuldeepak bajaj created BEANUTILS-466:
-----------------------------------------

             Summary: Threads are blocked while creating LazyDynaBean objects.
                 Key: BEANUTILS-466
                 URL: https://issues.apache.org/jira/browse/BEANUTILS-466
             Project: Commons BeanUtils
          Issue Type: Improvement
          Components: DynaBean
    Affects Versions: 1.8.3
            Reporter: kuldeepak bajaj


We have extended LazyDynaBean class and using these derived classes as data beans. 
Thread dumps of our application shows lot of threads blocking to take lock of HashTable as follows
{noformat} 
"[ACTIVE] ExecuteThread: '33' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=3 tid=0x0000000119978800 nid=0x96 waiting for monitor entry [0xfffffffd2cbfa000]
   java.lang.Thread.State: BLOCKED (on object monitor)
                at java.util.Hashtable.get(Hashtable.java:333)
                - waiting to lock <0xfffffffd7bcea6a0> (a java.util.Hashtable)
                at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:233)
                at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:209)
                at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
                at org.apache.commons.beanutils.LazyDynaBean.<init>(LazyDynaBean.java:119)
 {noformat}
Reasons:-
1)  LazyDynaBean have transient instance type Log object created at LazyDynaBean object creation. 
2)  LogFactoryImpl uses Hashtable to cache Log instances.
 
Our Proposal:-
Can we differ creation of Log object until it is actually required? This class already have method logger() which creates Log object if it null(required for Deserialization). And same method currently is being used whenever Log object is required in this class. So we can keep Log object as null at LazyDynaBean object creation.  




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)