zsmartsystems / com.zsmartsystems.zigbee

ZigBee Cluster Library Java framework supporting multiple dongles
Eclipse Public License 1.0
138 stars 87 forks source link

Configure removal of scheduled tasks which have been cancelled #1393

Closed ViToni closed 1 year ago

ViToni commented 1 year ago

ScheduledThreadPoolExecutor retains cancelled tasks until they would be due to avoid clean up overhead. As we cancel scheduled tasks regularly, we want to get rid of cancelled tasks even with the penalty of the clean up overhead otherwise we might have an excessive memory usage when having many tasks scheduled in the distant future which are then cancelled. The retention policy of ScheduledThreadPoolExecutor is configured via setRemoveOnCancelPolicy(boolean).

cdjackson commented 1 year ago

Thanks @ViToni