[Monitoring] HttpExportBulk shouldn't bother setting payload to null (elastic/x-pack-elasticsearch#4287)
This avoid setting the payload to `null` when sending it to the remote
monitoring cluster. The payload will be GCed when this overall object is
GCed, which should be very soon anyway.
Original commit: elastic/x-pack-elasticsearch@f97f0fd11c47f29bd0f3158c5bb0cd21ba48382a
@@ -96,9 +96,6 @@ class HttpExportBulk extends ExportBulk {
} else if (payload.length != 0) {
final HttpEntity body = new ByteArrayEntity(payload, ContentType.APPLICATION_JSON);
- // free the memory
- payload = null;
-
client.performRequestAsync("POST", "/_bulk", params, body, new ResponseListener() {
@Override
public void onSuccess(Response response) {
