Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ public void suiteSetUp() throws Exception {
taskPollingService = Executors.newFixedThreadPool(1);
storeBufferService = new StoreBufferService(
3,
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The buffer capacity increase from 10000 to 100000 (10x) appears to be a significant change for a test configuration. While this change may be necessary due to the more accurate heap size calculation now including headers, it would be helpful to add a comment explaining why this specific value was chosen and how it relates to the heap size estimation fix. This will help future maintainers understand the relationship between this test configuration and the heap size calculation change.

Suggested change
3,
3,
// Increased buffer capacity from 10,000 to 100,000 (10x) due to more accurate heap size calculation now including headers.
// This value ensures the test configuration remains valid with the heap size estimation fix.

Copilot uses AI. Check for mistakes.
10000,
100000,
1000,
isStoreWriterBufferAfterLeaderLogicEnabled(),
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public String toString() {
public int getHeapSize() {
/** The {@link #topicPartition} is supposed to be a shared instance, and is therefore ignored. */
return SHALLOW_CLASS_OVERHEAD + InstanceSizeEstimator.getObjectSize(key)
+ InstanceSizeEstimator.getObjectSize(value) + InstanceSizeEstimator.getObjectSize(pubSubPosition);
+ InstanceSizeEstimator.getObjectSize(value) + InstanceSizeEstimator.getObjectSize(pubSubPosition)
+ (pubSubMessageHeaders != null ? InstanceSizeEstimator.getObjectSize(pubSubMessageHeaders) : 0);
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The heap size calculation now includes pubSubMessageHeaders, but there are no tests specifically verifying that getHeapSize() correctly accounts for headers when they are present. Consider adding a test case in InstanceSizeEstimatorTest that creates an ImmutablePubSubMessage with headers (using the 7-parameter constructor) to ensure the heap size estimation is accurate when headers are included. This is important since the PR description indicates headers can be as large as 16KB and are now a significant contributor to memory usage.

Copilot uses AI. Check for mistakes.
}
}
Loading