Skip to content

Commit

Permalink
[fix](Export) fix a memory leak in the FE because of the ExportJob (#…
Browse files Browse the repository at this point in the history
…44019)

### What problem does this PR solve?

Problem Summary:
When an `Export` job has finished or been cancelled, `ExportMgr` will
maintain a reference of the `ExportJob` object. Therefore, we need to
clear these no longer used objects; otherwise it will cause a memory
leak in the FE.
  • Loading branch information
BePPPower authored Nov 17, 2024
1 parent 5523e9c commit 27132c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fe/fe-core/src/main/java/org/apache/doris/load/ExportJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,9 @@ private void cancelExportJobUnprotected(ExportFailMsg.CancelType type, String ms
finishTimeMs = System.currentTimeMillis();
failMsg = new ExportFailMsg(type, msg);
jobExecutorList.clear();
selectStmtListPerParallel.clear();
allOutfileInfo.clear();
partitionToVersion.clear();
if (FeConstants.runningUnitTest) {
return;
}
Expand Down Expand Up @@ -750,6 +753,9 @@ private void finishExportJobUnprotected() {
outfileInfo = GsonUtils.GSON.toJson(allOutfileInfo);
// Clear the jobExecutorList to release memory.
jobExecutorList.clear();
selectStmtListPerParallel.clear();
allOutfileInfo.clear();
partitionToVersion.clear();
Env.getCurrentEnv().getEditLog().logExportUpdateState(this, ExportJobState.FINISHED);
LOG.info("finish export job {}", id);
}
Expand Down

0 comments on commit 27132c8

Please sign in to comment.