Heap consumed by many org.jboss.sun.net.httpserver.HttpConnections

Solution Unverified - Updated

Environment

  • JBoss Enterprise Application Platform (EAP) 6.x

Issue

  • We see large amounts of heap usage by many org.jboss.sun.net.httpserver.HttpConnections that have accumulated over a long time. These HttpConnections are retained in org.jboss.sun.net.httpserver.ServerImpl's reqConnetions or rspConnections map.

Resolution

  • Set the sun.net.httpserver.maxReqTime and sun.net.httpserver.maxRspTime system properties (in seconds) to close and release such connections from heap after the specified time. These will be released by a background timer task, and the sun.net.httpserver.timerMillis property controls how often that timer runs; default is 1000 ms.

Diagnostic Steps

  • Check connection states from the heap dump with the following OQL:
SELECT raw.bbuf.hb.toString(), creationTime, closed, rspStartedTime, time, state.name.value.toString(), selectionKey.channel.localAddress.holder.port, selectionKey.channel.remoteAddress.holder.addr.holder.address FROM org.jboss.sun.net.httpserver.HttpConnection 
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.