本文介绍了Jetty服务线程崩溃并使用100%CPU的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Jetty有一个奇怪的问题。一段时间后,服务请求,CPU使用率达到100%。我发现线程负责,以下是eclipse中的一些堆栈跟踪示例:

I have a strange problem with Jetty. After a while, serving requests, the CPU usage goes to 100%. I have found the thread responsible, and here are a few samples of its stack trace taken in eclipse:

SocketInputStream.read(byte[], int, int) line: 113  
ByteArrayBuffer.readFrom(InputStream, int) line: 388    
SocketConnector$ConnectorEndPoint(StreamEndPoint).fill(Buffer) line: 132    
SocketConnector$ConnectorEndPoint.fill(Buffer) line: 209    
HttpParser.parseNext() line: 289    
HttpParser.parseAvailable() line: 214   
HttpConnection.handle() line: 411   
SocketConnector$ConnectorEndPoint.run() line: 241   
QueuedThreadPool$3.run() line: 529  
Thread.run() line: 680

Throwable.fillInStackTrace() line: not available [native method]    
SocketException(Throwable).<init>(String) line: 196 
SocketException(Exception).<init>(String) line: 41  
SocketException(IOException).<init>(String) line: 41    
SocketException.<init>(String) line: 29 
SocketInputStream.read(byte[], int, int) line: 113  
ByteArrayBuffer.readFrom(InputStream, int) line: 388    
SocketConnector$ConnectorEndPoint(StreamEndPoint).fill(Buffer) line: 132    
SocketConnector$ConnectorEndPoint.fill(Buffer) line: 209    
HttpParser.parseNext() line: 289    
HttpParser.parseAvailable() line: 214   
HttpConnection.handle() line: 411   
SocketConnector$ConnectorEndPoint.run() line: 241   
QueuedThreadPool$3.run() line: 529  
Thread.run() line: 680  

ByteArrayBuffer.readFrom(InputStream, int) line: 388    
SocketConnector$ConnectorEndPoint(StreamEndPoint).fill(Buffer) line: 132    
SocketConnector$ConnectorEndPoint.fill(Buffer) line: 209    
HttpParser.parseNext() line: 289    
HttpParser.parseAvailable() line: 214   
HttpConnection.handle() line: 411   
SocketConnector$ConnectorEndPoint.run() line: 241   
QueuedThreadPool$3.run() line: 529  
Thread.run() line: 680  

SocketConnector$ConnectorEndPoint.fill(Buffer) line: 209    
HttpParser.parseNext() line: 289    
HttpParser.parseAvailable() line: 214   
HttpConnection.handle() line: 411   
SocketConnector$ConnectorEndPoint.run() line: 241   
QueuedThreadPool$3.run() line: 529  
Thread.run() line: 680  

这些跟踪是在没有客户端连接的情况下进行的,也就是说,重新启动受影响的线程并再次挂起以获取堆栈跟踪就足够了。有什么想法?

These traces were taken with no clients connected, that is, it was sufficient to re-start the affected Thread and suspend it again to take the stack trace. Anyone have any ideas?

编辑:这是相关的,我想知道:

Is this related, I wonder: How to get Jetty thread dump?

推荐答案

它运行多长时间在它执行此操作之前?

How long does it run before it does this?

您是否使用-server开关启动JVM?如果你不这样做,我建议这样做。

Are you starting the JVM with the -server switch? I would recommend doing so if you're not.

对我而言,这听起来像是一个Jetty bug。也许可以尝试搜索他们的档案。

To me this sounds like a Jetty bug. Can maybe try searching their archives.

这篇关于Jetty服务线程崩溃并使用100%CPU的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 19:39