Skip to content

Small memory leak from the dag-processor in Airflow 3.x #50708

@zachliu

Description

@zachliu

Apache Airflow version

3.x

If "Other Airflow 2 version" selected, which one?

N/A

What happened?

There was a significant memory leak (1 Gb/hour depending on DAGs), tracked in #49887 and #50097, which has been addressed by #50558 or via this patch #49887 (comment).

However, one (maybe more) much smaller leak(s) remain—approximately 20 MB/hour—in the dag-processor

Image

What you think should happen instead?

Memory usage of the dag-processor shall be stable.

How to reproduce

Option 1: Run Airflow with only the example DAGs (active or pause, doesn't matter) and observe the growth of memory usage.

Option 2: Run airflow version command in a loop in any airflow container, and then observe the growth of memory usage.

#!/bin/bash

while true; do
  airflow version
  sleep 0.5
done

Operating System

LM 21.3 with docker python:3.12-slim-bookworm

Versions of Apache Airflow Providers

No response

Deployment

Docker-Compose

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions