Skip to content

Commit

Permalink
fix mem leak
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikyou1997 committed Nov 21, 2023
1 parent 2c4e3f0 commit ddbfe90
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ public AnalysisManager() {
if (!Env.isCheckpointThread()) {
this.taskExecutor = new AnalysisTaskExecutor(Config.statistics_simultaneously_running_task_num);
this.statisticsCache = new StatisticsCache();
taskExecutor.start();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class AnalysisTaskExecutor extends Thread {
public class AnalysisTaskExecutor {

private static final Logger LOG = LogManager.getLogger(AnalysisTaskExecutor.class);

Expand All @@ -50,19 +50,12 @@ public AnalysisTaskExecutor(int simultaneouslyRunningTaskNum) {
TimeUnit.DAYS, new LinkedBlockingQueue<>(),
new BlockedPolicy("Analysis Job Executor", Integer.MAX_VALUE),
"Analysis Job Executor", true);
cancelExpiredTask();
} else {
executors = null;
}
}

@Override
public void run() {
if (Env.isCheckpointThread()) {
return;
}
cancelExpiredTask();
}

private void cancelExpiredTask() {
String name = "Expired Analysis Task Killer";
Thread t = new Thread(this::doCancelExpiredJob, name);
Expand Down

0 comments on commit ddbfe90

Please sign in to comment.