Spring Rest Web应用程序 - 线程正在阻塞

时间:2017-11-08 11:13:57

标签: java multithreading performance jprofiler thread-dump

我们有一个基于Spring MVC的Web应用程序,它公开了REST服务(XML I / O)。但是当我们用50个用户(通过JMeter)命中时,我们所有的线程都进入阻塞状态。我们通过JProfiler捕获了Thread Dump。所以我们有49个被阻塞的线程,而其他线程处于等待状态。

所以这里是两个线程的转储。线程3被阻止。

Thread "default task-3":
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.find(java.lang.String) (line: 143)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.find(java.lang.ClassLoader, java.lang.String) (line: 59)
at com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(java.lang.Class, java.lang.String, java.lang.String, java.lang.String[ ]) (line: 41)
at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(java.lang.reflect.Method, java.lang.reflect.Method) (line: 77)
at com.sun.xml.bind.v2.runtime.reflect.Accessor$GetterSetterReflection.optimize(com.sun.xml.bind.v2.runtime.JAXBContextImpl) (line: 317)
at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.<init>(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.runtime.Transducer, com.sun.xml.bind.v2.runtime.reflect.Accessor) (line: 195)
at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor.get(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.model.runtime.RuntimeNonElementRef) (line: 137)
at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.<init>(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.model.runtime.RuntimeElementPropertyInfo) (line: 47)
at sun.reflect.GeneratedConstructorAccessor94.newInstance(java.lang.Object[ ])
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(java.lang.Object[ ]) (line: 45)
at java.lang.reflect.Constructor.newInstance(java.lang.Object[ ]) (line: 423)
at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.model.runtime.RuntimePropertyInfo) (line: 88)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.model.runtime.RuntimeClassInfo) (line: 135)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(com.sun.xml.bind.v2.model.runtime.RuntimeClassInfo) (line: 448)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(com.sun.xml.bind.v2.model.runtime.RuntimeTypeInfo) (line: 467)
at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.model.runtime.RuntimeElementPropertyInfo) (line: 72)
at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.model.runtime.RuntimeElementPropertyInfo) (line: 22)
at sun.reflect.GeneratedConstructorAccessor96.newInstance(java.lang.Object[ ])
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(java.lang.Object[ ]) (line: 45)
at java.lang.reflect.Constructor.newInstance(java.lang.Object[ ]) (line: 423)
at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.model.runtime.RuntimePropertyInfo) (line: 88)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.model.runtime.RuntimeClassInfo) (line: 135)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(com.sun.xml.bind.v2.model.runtime.RuntimeClassInfo) (line: 448)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(com.sun.xml.bind.v2.model.runtime.RuntimeTypeInfo) (line: 467)
at com.sun.xml.bind.v2.runtime.property.SingleElementNodeProperty.<init>(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.model.runtime.RuntimeElementPropertyInfo) (line: 63)
at sun.reflect.GeneratedConstructorAccessor95.newInstance(java.lang.Object[ ])
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(java.lang.Object[ ]) (line: 45)
at java.lang.reflect.Constructor.newInstance(java.lang.Object[ ]) (line: 423)
at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.model.runtime.RuntimePropertyInfo) (line: 88)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.model.runtime.RuntimeClassInfo) (line: 135)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(com.sun.xml.bind.v2.model.runtime.RuntimeClassInfo) (line: 448)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(com.sun.xml.bind.v2.model.runtime.RuntimeTypeInfo) (line: 467)
at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.model.runtime.RuntimeElementPropertyInfo) (line: 72)
at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.model.runtime.RuntimeElementPropertyInfo) (line: 22)
at sun.reflect.GeneratedConstructorAccessor96.newInstance(java.lang.Object[ ])
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(java.lang.Object[ ]) (line: 45)
at java.lang.reflect.Constructor.newInstance(java.lang.Object[ ]) (line: 423)
at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.model.runtime.RuntimePropertyInfo) (line: 88)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(com.sun.xml.bind.v2.runtime.JAXBContextImpl, com.sun.xml.bind.v2.model.runtime.RuntimeClassInfo) (line: 135)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(com.sun.xml.bind.v2.model.runtime.RuntimeClassInfo) (line: 448)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(com.sun.xml.bind.v2.model.runtime.RuntimeTypeInfo) (line: 467)

线程30处于等待状态。

Thread "default task-30":
    at sun.misc.Unsafe.park(boolean, long)
    at java.util.concurrent.locks.LockSupport.park(java.lang.Object) (line: 175)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() (line: 2039)
    at java.util.concurrent.LinkedBlockingQueue.take() (line: 442)
    at java.util.concurrent.ThreadPoolExecutor.getTask() (line: 1074)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (line: 1134)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run() (line: 624)
    at java.lang.Thread.run() (line: 748)

有关阻止线程的更多信息。

default task-51 - priority:5 - threadId:0x00007fbe64127000 - nativeId:0x227f - state:BLOCKED
stackTrace:
java.lang.Thread.State: BLOCKED (on object monitor)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.inject(Injector.java:121)
- waiting to lock <0x000000008c22d560> (a com.sun.xml.bind.v2.runtime.reflect.opt.Injector)
at com.sun.xml.bind.v2.runtime.reflect.opt.Injector.inject(Injector.java:48)
at com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:51)
at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:77)
at com.sun.xml.bind.v2.runtime.reflect.Accessor$GetterSetterReflection.optimize(Accessor.java:317)
at com.sun.xml.bind.v2.runtime.property.SingleElementLeafProperty.<init>(SingleElementLeafProperty.java:45)
at sun.reflect.GeneratedConstructorAccessor94.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:88)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:135)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:448)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:467)
at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:72)
at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:22)
at sun.reflect.GeneratedConstructorAccessor96.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:88)
at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:135)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:448)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:467)

我不确定究竟是什么问题?

0 个答案:

没有答案