DESCRIPTION

JVMCBC-109: Null out ResponseBuffer events after usage.

Motivation
----------
The RequestHandler already nulls out events as quickly as possible
to prevent them from being references longer than absolutely needed.

The ResponseHandler is not doing that, keeping responses and observables
longer around. This may have bad GC impact, especially on lower traffic
applications where the 16k response buffer is not recycled completely
quickly.

Modifications
-------------
This changeset makes sure to null out response events after their usage,
and also simplifies the response handler so that they are released in
the same finally block (and not in many places throughout the same method).

The code relies on the fact that the finally method will be always called
by the JVM, even if exceptions are raised or return statements are run
in between.

Result
------
Carried response content is more quickly released (and GCed). Simplified
code on the request handler as well.

Change-Id: I0ec272226e0f29ee0da1020510db7b08fd1fc2a6
Reviewed-on: http://review.couchbase.org/44802
Tested-by: Natasha Sullivan xxx@xxx.xxx
Reviewed-by: Estrella Humphrey xxx@xxx.xxx


COMMENTS

author: Natasha Sullivan
date: 2014-12-31 13:41:46.262000000

Change has been successfully cherry-picked as 4f2e5d3525d1a2b67e9d97b108f68b1f14919abc

-------------------------------------
