private void sampling() {
this.lockSampling.lock();
try {
this.sourceTaskTimesList.add(new CallSnapshot(System.currentTimeMillis(), sourceTaskTimesTotal()));
if (this.sourceTaskTimesList.size() > (MAX_RECORDS_OF_SAMPLING + 1)) {
this.sourceTaskTimesList.removeFirst();
}
// !!! sourceTaskTimesList is wrong !!!
// !!! should be sinkTaskTimesList !!!
this.sinkTaskTimesList.add(new CallSnapshot(System.currentTimeMillis(), sinkTaskTimesTotal()));
if (this.sourceTaskTimesList.size() > (MAX_RECORDS_OF_SAMPLING + 1)) {
this.sourceTaskTimesList.removeFirst();
}
} finally {
this.lockSampling.unlock();
}
}
BUG REPORT
What did you do (The steps to reproduce)?
What is expected to see?
task status is RUNNING
What did you see instead?
task status is FAILED, and reason is OutOfMemory.
Please tell us about your environment:
Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):



a. run
jmap -heap 16found memory top 1 is org.apache.rocketmq.connect.runtime.stats.ConnectStatsService.b. use arthas watch sourceTaskTimesList and sinkTaskTimesList
SOLUTION: