简体   繁体   English

Weblogic类加载器中的线程被卡住

[英]Stuck threads in weblogic classloader

We have a situation here where more than 100 threads are stuck in a weblogic (10.3.6) managed server. 在这种情况下,Weblogic(10.3.6)受管服务器中阻塞了100多个线程。

I am analysing a threaddump and find 150 threads blocked waiting on a lock in the classloader, like : "jmsContainer-14" prio=10 tid=0x00007f11485d7000 nid=0x14c8 waiting for monitor entry [0x00007f1023590000] java.lang.Thread.State: BLOCKED (on object monitor) at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:48) - waiting to lock <0x0000000782aeb288> (a weblogic.utils.classloaders.ChangeAwareClassLoader) at ch.qos.logback.classic.spi.PackagingDataCalculator.loadClass(PackagingDataCalculator.java:207) 我正在分析一个线程转储,发现有150个线程在类加载器中等待锁定而被阻塞,例如: "jmsContainer-14" prio=10 tid=0x00007f11485d7000 nid=0x14c8 waiting for monitor entry [0x00007f1023590000] java.lang.Thread.State: BLOCKED (on object monitor) at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:48) - waiting to lock <0x0000000782aeb288> (a weblogic.utils.classloaders.ChangeAwareClassLoader) at ch.qos.logback.classic.spi.PackagingDataCalculator.loadClass(PackagingDataCalculator.java:207)

(10 occurences) (10次发生)

or 要么

"[STUCK] ExecuteThread: '30' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=10 tid=0x00007f10d002d800 nid=0x5ea5 waiting for monitor entry [0x00007f1136eeb000] java.lang.Thread.State: BLOCKED (on object monitor) at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:48) - waiting to lock <0x0000000782aeb288> (a weblogic.utils.classloaders.ChangeAwareClassLoader) at javax.xml.datatype.FactoryFinder.getProviderClass(FactoryFinder.java:115) at javax.xml.datatype.FactoryFinder.newInstance(FactoryFinder.java:181)

(137) occurences (137)发生

No all stuck thread are blocked for the same reason, but we have 150 threads waiting to lock the same lock <0x0000000782aeb288>, wich I find strange because it is in the classLoader. 出于相同的原因,没有所有阻塞的线程被阻塞,但是我们有150个线程在等待锁定同一锁<0x0000000782aeb288>,直到我发现很奇怪,因为它在classLoader中。

I don't think it is the root cause of the problem we are experiencing right now, but if someone could explain this behavious it could be of great help. 我不认为这是我们当前遇到的问题的根本原因,但是如果有人可以解释这种行为,那将有很大帮助。

Thanks 谢谢

EDIT : 编辑:

Here is the blocking thread : 这是阻塞线程:

    ExecuteThread '136' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=10 tid=0x00007f11484af800 nid=0x7640 runnable [0x00007f102c11b000]
   java.lang.Thread.State: RUNNABLE
    at sun.nio.cs.UTF_8$Encoder.encode(UTF_8.java:632)
    at java.util.zip.ZipCoder.getBytes(ZipCoder.java:86)
    at java.util.zip.ZipFile.getEntry(ZipFile.java:306)
    - locked <0x0000000782b2ddf8> (a java.util.jar.JarFile)
    at java.util.jar.JarFile.getEntry(JarFile.java:226)
    at weblogic.utils.classloaders.ZipClassFinder.getSource(ZipClassFinder.java:39)
    at weblogic.utils.classloaders.JarClassFinder.getSource(JarClassFinder.java:50)
    at weblogic.utils.classloaders.AbstractClassFinder.getClassSource(AbstractClassFinder.java:31)
    at weblogic.utils.classloaders.MultiClassFinder.getClassSource(MultiClassFinder.java:58)
    at weblogic.utils.classloaders.MultiClassFinder.getClassSource(MultiClassFinder.java:58)
    at weblogic.utils.classloaders.MultiClassFinder.getClassSource(MultiClassFinder.java:58)
    at weblogic.utils.classloaders.MultiClassFinder.getClassSource(MultiClassFinder.java:58)
    at weblogic.application.utils.CompositeWebAppFinder.getClassSource(CompositeWebAppFinder.java:88)
    at weblogic.utils.classloaders.MultiClassFinder.getClassSource(MultiClassFinder.java:58)
    at weblogic.utils.classloaders.MultiClassFinder.getClassSource(MultiClassFinder.java:58)
    at weblogic.utils.classloaders.CodeGenClassFinder.getClassSource(CodeGenClassFinder.java:25)
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:291)
    - eliminated <0x0000000782aeb288> (a weblogic.utils.classloaders.ChangeAwareClassLoader)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:49)
    - locked <0x0000000782aeb288> (a weblogic.utils.classloaders.ChangeAwareClassLoader)
    at javax.xml.datatype.FactoryFinder.getProviderClass(FactoryFinder.java:115)
    at javax.xml.datatype.FactoryFinder.newInstance(FactoryFinder.java:181)

sorry, I should have posted it earlier. 抱歉,我应该早点发布。

Nearly all the threads are bloked in, or blocked by one of two lines of codes containing this piece of code: 几乎所有线程都被包含此代码的两行代码之一阻塞或阻塞:

DatatypeFactory.newInstance().newXMLGregorianCalendar(dateDebCre)

Apparently Weblogic is trying very hard to load the same jar again and again. 显然,Weblogic努力地一次又一次地加载相同的jar。 Which I do not understand, because it is supposed to be stored in a cache in memory, right ? 我不明白,因为它应该存储在内存中的缓存中,对吗?

First, we will remove this lines of code as they are completely useless (a shame it is). 首先,我们将删除这些代码行,因为它们完全没有用(很可惜)。 But again, I think understanding the problem would be better. 但是我再次认为,理解问题会更好。

Thank you 谢谢

First you need to find out who is holding lock <0x0000000782aeb288>. 首先,您需要找出谁持有锁<0x0000000782aeb288>。 If possible attach complete thread dump so that I can have a look. 如果可能,请附加完整的线程转储,以便我看看。

From the thread dump it also looks like source code is trying to read data from zip file. 从线程转储中,它看起来也像源代码正在尝试从zip文件读取数据。 If the size of the files are huge then it can lead to potential issue If you are running on linux then you can check in /var/proc directory if the process is doing a lot of IO 如果文件很大,则可能导致潜在的问题。如果您正在linux上运行,则可以检查/ var / proc目录中进程是否进行了大量的IO操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM