Run python with jemalloc in containers

jemalloc is apparently good with python memory according to

  https://zapier.com/engineering/celery-python-jemalloc/

Also, according to these graphs from Tobias:

  https://paste.pics/581cc286226407ab0be400b94951a7d9

it helps with the apparent memory leak seen in python3.6
and python3.7 with zuul.

There doesn't seem to be any downside to it, so install it
and enable it.

Change-Id: I354bc35e5fa1aee90e1c8b6918c5a70dafd4f990
This commit is contained in:
Monty Taylor 2019-02-09 13:55:24 +00:00 committed by James E. Blair
parent 9adc5ce8fe
commit d7c0be958d
1 changed files with 2 additions and 1 deletions

View File

@ -16,7 +16,8 @@
FROM python:slim
RUN apt-get update \
&& apt-get install -y dumb-init \
&& apt-get install -y dumb-init libjemalloc1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV LD_PRELOAD /usr/lib/x86_64-linux-gnu/libjemalloc.so.1
ENTRYPOINT ["/usr/bin/dumb-init", "--"]