[ 
https://issues.apache.org/jira/browse/AXIS2-5118?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13083105#comment-13083105
 ] 

Ronald Brindl edited comment on AXIS2-5118 at 8/11/11 1:20 PM:
---------------------------------------------------------------

Added BeanInfoCache.java, which caches BeanInfo Objects using a limited linked 
list, which removes oldest entries based on maximum size (currently MAX_SIZE = 
10). 
It is thread safe using a ReentrandReadWrite Lock for accessing its backing 
list.

In BeanInfo i replaced the call

BeanInfo beanInfo = Introspector.getBeanInfo(beanClass, 
beanClass.getSuperclass());

with 

            BeanInfo beanInfo = BeanInfoCache.get(beanClass);
            if(beanInfo == null) {
                beanInfo = Introspector.getBeanInfo(beanClass, 
beanClass.getSuperclass());
                BeanInfoCache.put(beanClass, beanInfo);
            }



      was (Author: rbrindl):
    Added BeanInfoCache.java, which caches BeanInfo Objects using a limited 
linked list, which removes oldest entries based on maximum size (currently 
MAX_SIZE = 10). 
It is thread safe using a ReentrandReadWrite Lock for accessing its backing 
list.

In BeanInfo i replaced the call
{code}
BeanInfo beanInfo = Introspector.getBeanInfo(beanClass, 
beanClass.getSuperclass());
{code}
with 
{code}
            BeanInfo beanInfo = BeanInfoCache.get(beanClass);
            if(beanInfo == null) {
                beanInfo = Introspector.getBeanInfo(beanClass, 
beanClass.getSuperclass());
                BeanInfoCache.put(beanClass, beanInfo);
            }
{code}

  
> In high load scenarios with many threads, the call to 
> Introspector.getBeanInfo(Class,Class) causes high synchronization resulting 
> in system stall
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AXIS2-5118
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5118
>             Project: Axis2
>          Issue Type: Improvement
>          Components: adb
>    Affects Versions: 1.5.4
>         Environment: Tomcat 7 with axis2 webservices
>            Reporter: Ronald Brindl
>         Attachments: BeanInfoCache.java, BeanInfoCacheTest.java, BeanUtil.java
>
>
> I have a high load scenario, where a Clustered Web frontend does Webservice 
> calls to a Backend Webservices. 
> There are around 200 Threads handling the webservices.
> The CPU load of the machine went to near zero.
> Using dynatrace, we realized, that all the calls went through 
> BeanUtils.getPropertyQnameList, which in turn calls 
> Introspector.getBeanInfo(beanClass, beanClass.getSuperclass());
> This again calls WebAppClassLoader.loadClass(String name, boolean resolve), 
> which is synchronized.
> I fixed this problem by modifying BeanUtil.getPropertyQnameList so that it 
> caches BeanInfo objects.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to