File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ RUN pip install dist/*.whl
2424# This is a no-op unless DD_PROFILING_ENABLED or similar env vars are set at runtime.
2525RUN pip install "ddtrace>=2.16,<3"
2626
27+ # Install jemalloc to replace glibc's malloc. jemalloc returns freed memory to the OS
28+ # much more aggressively than glibc, preventing unbounded RSS growth in long-running syncs
29+ # caused by native C allocation fragmentation (urllib3, OpenSSL, orjson, etc.).
30+ RUN apt-get update && apt-get install -y --no-install-recommends libjemalloc2 && rm -rf /var/lib/apt/lists/*
31+ ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
32+
2733# Recreate the original structure
2834RUN mkdir -p source_declarative_manifest \
2935 && echo 'from source_declarative_manifest.run import run\n\n if __name__ == "__main__":\n run()' > main.py \
You can’t perform that action at this time.
0 commit comments