From ddbfe90fce5d8550c0f80ea2f4eb416e0425f427 Mon Sep 17 00:00:00 2001 From: kikyo Date: Tue, 21 Nov 2023 12:23:37 +0800 Subject: [PATCH] fix mem leak --- .../org/apache/doris/statistics/AnalysisManager.java | 1 - .../apache/doris/statistics/AnalysisTaskExecutor.java | 11 ++--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java b/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java index 91f54208f6acd0c..e5d997d34258258 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java +++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisManager.java @@ -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(); } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisTaskExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisTaskExecutor.java index 58bae9fe66b5cae..fb4530837e4afd9 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisTaskExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/statistics/AnalysisTaskExecutor.java @@ -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); @@ -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);