Jetty服务线程崩溃并使用100%CPU

时间:2011-09-13 15:55:45

标签: java http jetty

Jetty有一个奇怪的问题。一段时间后,服务请求,CPU使用率达到100%。我发现线程负责,这里有一些在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  

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

编辑:这是相关的,我想知道:How to get Jetty thread dump?

1 个答案:

答案 0 :(得分:0)

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

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

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