Lianet Magrans created KAFKA-21477:
--------------------------------------

             Summary: Move KafkaConsumerTest class-level spy to local to avoid 
unneeded memory overhead
                 Key: KAFKA-21477
                 URL: https://issues.apache.org/jira/browse/KAFKA-21477
             Project: Kafka
          Issue Type: Task
          Components: clients
            Reporter: Lianet Magrans
            Assignee: Lianet Magrans


KafkaConsumerTEst has a Subscription state spy at the class level 
[https://github.com/apache/kafka/blob/c52095ac83b085b9cf52b2b5bd088edc6b25516e/clients/src/test/java/org/apache/kafka/clients/consumer/KafkaConsumerTest.java#L245]
 

This is problematic from the memory usage pov, because mockito records each 
method call, and even though only two tests verify on it, every other test uses 
it too, so all calls end up being recorded (about 200 references in the class).

This was behind a real OOM in an AK 3.9 backport (that allows less mem)



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to