BUG-3219: implement a shared stash for queue reuse 40/20740/5
authorRobert Varga <rovarga@cisco.com>
Tue, 19 May 2015 15:14:06 +0000 (17:14 +0200)
committerRobert Varga <rovarga@cisco.com>
Thu, 21 May 2015 12:59:15 +0000 (14:59 +0200)
commitb95f82e5129f22e7b22352d028b0d32d744e924d
tree6303b07379bf104dc557e4b07c867ca148871ced
parentbe5f0cac1babcfccc7209657f2541dd0818c5cb0
BUG-3219: implement a shared stash for queue reuse

This introduces a global per-size stash for reuse of OutbountQueueImpl
objects. This allows for efficient reuse across multiple sessions, which
means we minimize stale memory use when some channels are idle.

The stash is implemented in terms of a ConcurrentLinkedDeque, which is
flushed from the tail and has soft references. We rely on
FinalizableReference to notify us when a particular queue is finished.

Change-Id: I78e654a0c3470bbd1c9274237b2be04f50459809
Signed-off-by: Robert Varga <rovarga@cisco.com>
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/ConnectionAdapterImpl.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/OutboundQueueCache.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/OutboundQueueCacheSlice.java [new file with mode: 0644]
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/OutboundQueueImpl.java
openflow-protocol-impl/src/main/java/org/opendaylight/openflowjava/protocol/impl/core/connection/OutboundQueueManager.java