Large heap overhead in JBossWeb Response OutputBuffers

Solution Verified - Updated

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 5.x
    • 6.x
  • JSF

Issue

  • We see OOMEs with large heap overhead in JBossWeb Response OutputBuffers. Idle Response processors have OutputBuffers with very large bb arrays. Processors actively serving requests have OutputBuffers with large bb arrays and large outputCharChunk arrays.

Resolution

  • Increase heap to account for the load and increased buffer overhead.
  • Decrease any buffer sizes being increased via the javax.faces.FACELETS_BUFFER_SIZE system property or response.setBufferSize calls

Root Cause

  • Application code is providing a high value to response.setBufferSize. This increases the OutputBuffer's bb array. That array is typically limited to 8192 bytes by default, but if increased by a request, it will never be decreased for that OutputBuffer, even after request completion.
  • javax.faces.FACELETS_BUFFER_SIZE is set high (which inherently passes its value on to response.setBufferSize). This will also result in large outputCharChunks on the OutputBuffer, but this overhead is temporary and will pass upon request completion.
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.