felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "AnilKumar Attuluri (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-5665) High CPU usage on org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation
Date Thu, 20 Jul 2017 18:00:00 GMT

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

AnilKumar Attuluri commented on FELIX-5665:
-------------------------------------------

[~karlpauls]

I was finally able to see the trace for whats resulting in a lot of calls to *findClassOrResourceByDelegation*
which I think is causing a CPU spike:


{code:java}
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.DelegatingMethodAccessorImpl, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor24, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor24, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.DelegatingMethodAccessorImpl, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor24, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.DelegatingMethodAccessorImpl, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor24, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.DelegatingMethodAccessorImpl, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor24, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor24, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor24, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor24, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.DelegatingMethodAccessorImpl, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor24, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.DelegatingMethodAccessorImpl, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor24, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor24, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
Thu Jul 20 10:16:33 PDT 2017: Resource name: sun.reflect.GeneratedMethodAccessor23, Classloader:
BundleClassLoader
...
...
{code}


We do use reflection a lot in our code and I think its related to that.
The high CPU spikes correlate to these reflection based class loading events.

Does this ring any bells?

I went ahead and increased the *sun.reflect.inflationThreshold* system property to 150 and
I don't see regular CPU spikes any more (even though performance has taken some hit for obvious
reasons)

Reference: http://anshuiitk.blogspot.co.il/2010/11/excessive-full-garbage-collection.html

Thanks,
Anil


> High CPU usage on org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation
> ---------------------------------------------------------------------------------------------
>
>                 Key: FELIX-5665
>                 URL: https://issues.apache.org/jira/browse/FELIX-5665
>             Project: Felix
>          Issue Type: Bug
>    Affects Versions: framework-5.6.4
>            Reporter: AnilKumar Attuluri
>         Attachments: IMG_1.jpg, IMG_2.jpg
>
>
> We have been running some performance tests to prepare our OSGi bundle (*running in Apache
Karaf*) for production.
> Just to give some background about our OSGi bundle, we converted an existing Spring application
into an OSGi bundle with all the current dependencies packaged into the bundle as an uber
artifact.
> When we run >= 500 TPS (each of these calls results in a http call made via a library)
we run into this high CPU usage spikes reaching up to 100% CPU. Please see the image attached,
the spikes in the image are 100% CPU usage while the average is about 40%. Also see the CPU
sampler image which points to *org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation*
> Is there an existing bug/documentation that already captures this?
> We don't see this behavior when we run the same app in standalone JVM.
>  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message