Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-7300

CPU spike in i18n job

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Duplicate
    • i18n 2.5.10
    • None
    • i18n, Karaf
    • None
    • Linux, jdk1.8 latest version, Karaf 4.1.3

    Description

      Hi,

      I'm experiencing severe CPU spikes caused by the reload job in the i18n bundle. I've uploaded 3 threadumps which I analysed in http://fastthread.io. The analysis identified a cpu spike in the method scheduleReloadBundles of the class https://github.com/apache/sling-org-apache-sling-i18n/blob/master/src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java.

      This does not happen every time only on some situations. I've experienced this problem at least on the previous i18n bundle versions. Since there was changes on the mentioned class I've updated it hopping to get rid of this problem. Unfortunately I'm experiencing it again

      Thread dump bellow:

      sling-default-1-JcrResourceBundleProvider: reload all resource bundles - priority:5 - threadId:0x00007f2ec851e800 - nativeId:0x1f72 - state:RUNNABLE
      stackTrace:
      java.lang.Thread.State: RUNNABLE
      at java.lang.ThreadLocal$ThreadLocalMap.getEntryAfterMiss(ThreadLocal.java:444)
      at java.lang.ThreadLocal$ThreadLocalMap.getEntry(ThreadLocal.java:419)
      at java.lang.ThreadLocal$ThreadLocalMap.access$000(ThreadLocal.java:298)
      at java.lang.ThreadLocal.get(ThreadLocal.java:163)
      at org.apache.logging.log4j.core.layout.StringBuilderEncoder.getByteBuffer(StringBuilderEncoder.java:115)
      at org.apache.logging.log4j.core.layout.StringBuilderEncoder.encode(StringBuilderEncoder.java:54)
      at org.apache.logging.log4j.core.layout.StringBuilderEncoder.encode(StringBuilderEncoder.java:32)
      at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:219)
      at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:57)
      at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.directEncodeEvent(AbstractOutputStreamAppender.java:177)
      at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.tryAppend(AbstractOutputStreamAppender.java:170)
      at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:161)
      at org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender.append(RollingRandomAccessFileAppender.java:218)
      at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156)
      at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129)
      at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:120)
      at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84)
      at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:448)
      at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:433)
      at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:417)
      at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:403)
      at org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:63)
      at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:146)
      at org.ops4j.pax.logging.log4j2.internal.PaxLoggerImpl.doLog0(PaxLoggerImpl.java:151)
      at org.ops4j.pax.logging.log4j2.internal.PaxLoggerImpl.doLog(PaxLoggerImpl.java:144)
      at org.ops4j.pax.logging.log4j2.internal.PaxLoggerImpl.inform(PaxLoggerImpl.java:176)
      at org.ops4j.pax.logging.internal.TrackingLogger.inform(TrackingLogger.java:86)
      at org.ops4j.pax.logging.slf4j.Slf4jLogger.info(Slf4jLogger.java:476)
      at org.apache.sling.i18n.impl.JcrResourceBundleProvider$1.run(JcrResourceBundleProvider.java:319)
      at org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:347)
      at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      Locked ownable synchronizers:

      • <0x00000000e6d47830> (a java.util.concurrent.ThreadPoolExecutor$Worker)

      Attachments

        1. 1.tdump
          242 kB
          Ivo Leitão
        2. 2.tdump
          242 kB
          Ivo Leitão
        3. 3.tdump
          242 kB
          Ivo Leitão
        4. cpuspike.png
          17 kB
          Ivo Leitão
        5. new1.tdump
          207 kB
          Ivo Leitão
        6. new2.tdump
          206 kB
          Ivo Leitão
        7. new3.tdump
          207 kB
          Ivo Leitão

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ivoleitao Ivo Leitão
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: