RockteMQ-AI commented on issue #542: URL: https://github.com/apache/rocketmq-connect/issues/542#issuecomment-5235126431
**Issue Evaluation** Category: `bug` | Status: **Confirmed** The OOM is caused by a copy-paste error in `ConnectStatsService.sampling()`. The second size-check block incorrectly checks `sourceTaskTimesList.size()` instead of `sinkTaskTimesList.size()`, so `sinkTaskTimesList` grows unboundedly. **Root Cause:** In the `sampling()` method, the second `if` block should check `this.sinkTaskTimesList.size()` but checks `this.sourceTaskTimesList.size()` instead. This means `sinkTaskTimesList` never gets trimmed, causing memory leak over time. **Impact:** Connect runtime OOM under sustained operation — the longer it runs, the more memory `sinkTaskTimesList` consumes. **Severity:** High — causes production failures (task status FAILED due to OOM). The fix is straightforward: change the second `if` condition to reference `sinkTaskTimesList`. --- *Automated evaluation by github-manager* -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
