From the Javadoc of java.util.concurrent.ScheduledThreadPoolExecutor:
"... a cancelled task is not automatically removed from
the work queue until its delay elapses. While this enables further
inspection and monitoring, it may also cause unbounded retention of
cancelled tasks. To avoid this, set setRemoveOnCancelPolicy to true,
which causes tasks to be immediately removed from the work queue at
time of cancellation."
Under sustained high load, a large number of tasks can accumulate leading to the "unbounded retention of cancelled tasks" mentioned in the Javadoc.
Note that when using STOMP messaging, after STOMP-level heartbeats are successfully negotiated, the SockJS heartbeats are suppressed. Hence this is only an issue if using the simple broker, or not using STOMP, or using a STOMP client that doesn't support heartbeats (e.g. simple test client) or has them explicitly disabled through the STOMP CONNECT frame header.
#16852 WebSocketMessageBrokerConfigurationSupport requiring JDK 7+ due to setRemoveOnCancelPolicy
The text was updated successfully, but these errors were encountered: