High CPU usage in io.undertow.servlet.spec.ServletPrintWriter.close() on JBoss EAP 7.x/8.0.x

Solution Verified - Updated

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 7.x
    • 8.0.x

Issue

  • JBoss EAP reaches a point of high CPU and we have to restart to clear it. High CPU consumers are shown on default task request processing threads in calls like below:
"default task-1" #175 prio=5 os_prio=0 tid=0x000055ff6ad45800 nid=0x23858c runnable [0x00007f89967fd000]
   java.lang.Thread.State: RUNNABLE
    at sun.nio.cs.UTF_8$Encoder.encodeLoop(UTF_8.java:693)
    at java.nio.charset.CharsetEncoder.encode(CharsetEncoder.java:579)
    at io.undertow.servlet.spec.ServletPrintWriter.close(ServletPrintWriter.java:104)
    at io.undertow.servlet.spec.ServletPrintWriterDelegate.close(ServletPrintWriterDelegate.java:81)
    at io.undertow.servlet.spec.HttpServletResponseImpl.closeStreamAndWriter(HttpServletResponseImpl.java:491)
    at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:586)
    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:328)
    ...(snip)...

Resolution

  • Update to EAP 7.4.20+ and EAP 8.0.5+

Root Cause

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.