Whenever a stateless session bean throws an exception, the instance is supposed to be discarded from memory. There is however a known issue in the InfinitePool which retains the instance regardless. Because the instances are retained, the server will at some point run out of memory if enough exception conditions have occurred. A ThreadlocalPool is backed by an InfinitePool, so it also is affected. There are two workarounds available:
<orderedlist>
<listitem><para>Periodically restart the server</para></listitem>
<listitem><para>Use StrictMaxPool</para></listitem>
</orderedlist>
Workaround 1 introduces a downtime period.
Workaround 2 introduces latency as the StrictMaxPool has a choke point for controlling the maxSize restriction. Additionally, the number of instances available might not be enough to service the load.
Whenever a stateless session bean throws an exception, the instance is supposed to be discarded from memory. There is however a known issue in the InfinitePool which retains the instance regardless. Because the instances are retained, the server will at some point run out of memory if enough exception conditions have occurred. A ThreadlocalPool is backed by an InfinitePool, so it also is affected. There are two workarounds available:
<orderedlist>
<listitem><para>Periodically restart the server</para></listitem>
<listitem><para>Use StrictMaxPool</para></listitem>
</orderedlist>
Workaround 1 introduces a downtime period.
Workaround 2 introduces latency as the StrictMaxPool has a choke point for controlling the maxSize restriction. Additionally, the number of instances available might not be enough to service the load.