File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ RUN apt-get update && \
4242 pkg-config \
4343 gcc \
4444 nano \
45- vim && \
45+ vim \
46+ libjemalloc2 \
47+ && \
4648 rm -rf /var/lib/apt/lists/* && \
4749 apt-get clean
4850
@@ -124,6 +126,13 @@ ENV PYTHONPATH=/app
124126ARG ONYX_VERSION=0.0.0-dev
125127ENV ONYX_VERSION=${ONYX_VERSION}
126128
129+ # Use jemalloc instead of glibc malloc to reduce memory fragmentation
130+ # in long-running Python processes (API server, Celery workers).
131+ # The soname is architecture-independent; the dynamic linker resolves
132+ # the correct path from standard library directories.
133+ # Placed after all RUN steps so build-time processes are unaffected.
134+ ENV LD_PRELOAD=libjemalloc.so.2
135+
127136# Default command which does nothing
128137# This container is used by api server and background which specify their own CMD
129138CMD ["tail" , "-f" , "/dev/null" ]
You can’t perform that action at this time.
0 commit comments