JBoss - Java heap retention in BasicThreadPool$TimeoutInfo

Solution Verified - Updated

Environment

  • JBoss Enterprise Application Platform

Issue

  • "java.lang.OutOfMemoryError: Java heap space" errors are received  because the heap is consumed by org.jboss.util.threadpool.BasicThreadPool$TimeoutInfo

  • This BasicThreadPool$TimeoutInfo is stored in a single instance of EDU.oswego.cs.dl.util.concurrent.Heap called tasksWithTimeouts by the TimeoutMonitor thread (another subclass of BasicThreadPool).

Resolution

  • Ensure the TimeoutMonitor thread is alive and running well as it times out tasks and iterates through and removes the TimeoutInfo.

Root Cause

  • The TimeoutMonitor thread's responsibility is to iterate through and remove the TimeoutInfo in tasksWithTimeouts.  It attempts to stop any tasks as needed that have exceeded their timeout without completing.
  • If something goes wrong with the TimeoutMonitor thread, these TimeoutInfo objects can build up.

Diagnostic Steps


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.