You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Sarah Hennenkamp (Jira)" <ji...@apache.org> on 2024/10/23 16:54:00 UTC

[jira] [Created] (KAFKA-17861) Serialize with ByteBuffer instead of byte[]

Sarah Hennenkamp created KAFKA-17861:
----------------------------------------

             Summary: Serialize with ByteBuffer instead of byte[]
                 Key: KAFKA-17861
                 URL: https://issues.apache.org/jira/browse/KAFKA-17861
             Project: Kafka
          Issue Type: Wish
          Components: producer 
    Affects Versions: 3.3.2
            Reporter: Sarah Hennenkamp


This is a request to consider changing the return value of the [Serializer|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/serialization/Serializer.java] from a byte[] to a ByteBuffer. 

 

Understandably folks may balk at this since it's a large lift. However, we've noticed a good chunk of memory allocation in our application comes from the [KafkaProducer serializing|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java#L1045] the key and value pair. Using ByteBuffer could allow this to be off-heap and save on garbage collection time.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)