GitHub user ijuma opened a pull request: https://github.com/apache/kafka/pull/1418
KAFKA-3747; Close `RecordBatch.records` when append to batch fails With this change, `test_producer_throughput` with message_size=10000, compression_type=snappy and a snappy buffer size of 32k can be executed in a heap of 192m in a local environment (768m is needed without this change). You can merge this pull request into a Git repository by running: $ git pull https://github.com/ijuma/kafka kafka-3747-close-record-batch-when-append-fails Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/1418.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1418 ---- commit 40b9076efc4f284bc0af2a83cb7754adc26ee362 Author: Ismael Juma <ism...@juma.me.uk> Date: 2016-05-23T16:26:15Z Close `RecordBatch` if `tryAppend` fails commit cb495aaea03778dda1a579a399ce0bf85c03ecfa Author: Ismael Juma <ism...@juma.me.uk> Date: 2016-05-23T16:27:56Z Use diamond operator in `RecordAccumulator` and prefer `Deque.isEmpty` over `size` ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---