English 中文(简体)
寻找等候/穿透镜的原因
原标题:Finding the cause for waiting/sleeping threads

我注意到,我的java申请(在编外6号上)发现了许多没有终止的read。

因此,我制造了一条read子堆放场,并注意到有吨的read子等待着。

"pool-1-thread-22" prio=5 tid=101b4b000 nid=0x127122000 waiting on condition [127121000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <6c340cee0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:680)
   Locked ownable synchronizers:
    - None

Now the question is: WHAT are these threads waiting for? I have suspect class which seems to spawn these threads but I don t know what exactly is making these threads stuck.

除了按行割裂阶级线和保持监测深层行为之外,我是否能够找到这一原因?

最佳回答

On tomcat, they re usually request worker threads waiting for someone to connect. Nothing to worry about. They re ready to handle those 100 users connecting at once to your server.

问题回答

Those threads are part of a ThreadPool. More specificaly java.util.concurrent.ThreadPoolExecutor. The thread is waiting on a Runnable/Callable to be submitted to the pool. For example

ExecutorService e = Executors.newFixedThreadPool(10);

Will create 10 threads that will sit an wait until

e.submit(new Runnable(){
  public void run(){ ...}
});

然后将通知一个线索并援引该线。 对我来说,他们正在使用什么是无法说的。 你们必须找到开始的read子。 或许会向应用程序服务器提出处理客户的请求。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签