Memory leak in message monitor

Description

MessageMonitor holds weak references to ApplicationInstances so that when a session is terminated, the ApplicationInstance can be garbage collected.
It also holds a TaskQueueHandle per ApplicationInstance; this is created by echo2 and has an implicit strong reference to the ApplicationInstance that created it. This prevents ApplicationInstances being garbage collected.
To prevent this:

  • SessionMonitor needs to dispose ApplicationInstances on session expiry

  • MessageMonitor needs to hold WeakReferences to TaskQueueHandles so that when the container terminates a session, the ApplicationInstance can be collected

Environment

None

Status

Assignee

Tim Anderson

Reporter

Tim Anderson

Labels

None

Fix versions

Affects versions

1.8

Priority

Major