# Producer network thread is leaking via DirectByteBuffer's

**URL:** <https://forum.confluent.io/t/producer-network-thread-is-leaking-via-directbytebuffers/7423>\
**Category:** Java Clients\
**Created:** [15 March 2023 15:16 UTC](https://forum.confluent.io/t/producer-network-thread-is-leaking-via-directbytebuffers/7423 "2023-03-15T15:16:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![basimons](https://avatars.discourse-cdn.com/v4/letter/b/3e96dc/32.png) [@basimons](https://forum.confluent.io/u/basimons)\
**Post date:** [15 March 2023 15:16 UTC](https://forum.confluent.io/t/producer-network-thread-is-leaking-via-directbytebuffers/7423/1 "2023-03-15T15:16:54Z")

</div>

Hi all, I also posted this [here](https://stackoverflow.com/questions/75651128/kafka-producer-direct-byte-buffer-memory-leak), but I didn’t get a response unfortunately.

I have a problem. The direct memory is linearly increasing by about 500 MB/6h. It does not seem to go down. After inspecting the heapdump with OQL (this query: `SELECT x, x.capacity FROM java.nio.DirectByteBuffer x WHERE ((x.capacity > 1024 * 1024) and (x.cleaner != null))`) I find that there are roughly 400 DirectByteBuffers with a capacity of ~4MB. It also does will not go down.

I am using (mostly) default properties for the producer settings, with a linger time of 100ms and `acks=all`.

After restarting, this goes to 0 again, and will gradually increase unitll we restart our service.

Again, see the stackoverflow for a detailed overview of my problem with some images.

Thanks in advance,

Bram
