Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 351801

Summary: 100% CPU when doing nothing
Product: [RT] Jetty Reporter: Ruben de Laat <ruben>
Component: serverAssignee: Greg Wilkins <gregw>
Status: CLOSED DUPLICATE QA Contact:
Severity: critical    
Priority: P3 CC: behrmann, jetty-inbox, mgorovoy
Version: 7.4.3   
Target Milestone: 7.5.x   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Code used to run the testcase
none
Test jsp file, prints 10.000 short strings to keep the CPU busy and create a substantial response
none
Test jsp file, prints 10.000 short strings to keep the CPU busy and create a substantial response none

Description Ruben de Laat CLA 2011-07-12 04:34:43 EDT
Build Identifier: 7.4.3

When running Jetty in embedded mode and sending a lot of requests in a short period (10 sec), the Java process jumps to 100% and stays there, also when no requests are being send anymore.

Reproducible: Always

Steps to Reproduce:
1. Start the Jetty server, see the attached code
2. Open a browser (tested with Chrome and IE), and go to the http://localhost/test.jsp
3. Keep pressing F5 for 10 seconds, eventually all cores will jump to 100%, overall CPU usage will go to 100% after a while.
4. Stop pressing F5, close your browser(s), jetty will keep using 100% CPU forever (tested it for more than one hour).

A few more details about the systems I have tested and reproduced this on:
- Intel Core 2 DUO, 4GB, Windows 7 32 bit, JDK_1.6.0_26
- Intel Core i5 QUAD, 6GB, Windows 7 64 bit, JDK_1.6.0_26
Comment 1 Ruben de Laat CLA 2011-07-12 04:35:55 EDT
Created attachment 199474 [details]
Code used to run the testcase
Comment 2 Ruben de Laat CLA 2011-07-12 04:37:50 EDT
Created attachment 199475 [details]
Test jsp file, prints 10.000 short strings to keep the CPU busy and create a substantial response
Comment 3 Ruben de Laat CLA 2011-07-12 04:39:17 EDT
Created attachment 199476 [details]
Test jsp file, prints 10.000 short strings to keep the CPU busy and create a substantial response
Comment 4 Gerd Behrmann CLA 2011-07-22 07:54:14 EDT
Probably a duplicate of bug 351624.
Comment 5 Ruben de Laat CLA 2011-08-01 04:26:37 EDT
(In reply to comment #4)
> Probably a duplicate of bug 351624.

I can confirm that the threads in my case show the same stacktrace as posted in issue 351624.
Comment 6 Michael Gorovoy CLA 2011-08-01 10:47:24 EDT
There is a new Thread Monitor tool in Jetty that has been developed over the past few weeks in attempt to automatically detect spinning and deadlocked threads on a live Jetty instance. This tool is part of the jetty-monitor module that can be added to your maven project as follows.

<dependency>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>jetty-monitor</artifactId>
  <version>7.5.0-SNAPSHOT</version>
</dependency>

Alternatively, you could download the snapshot directly here: http://goo.gl/cGJo1

For instructions on how to run this tool, please see README.txt file located here: http://goo.gl/UmZ4N

It would be great if you could run the Thread Monitor on your instance of Jetty and attach the log file collected after running the tool to bug 351624.

-Michael

*** This bug has been marked as a duplicate of bug 351624 ***