Skip to content

Commit

Permalink
TRY-198: add jemalloc to docker file to debug memory leak issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-kripakov-m10 committed Nov 30, 2023
1 parent 37bd8f1 commit 4bac333
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,26 @@ RUN mvn package -Dmaven.test.skip=true -Dmaven.site.skip=true -Dmaven.javadoc.sk
FROM eclipse-temurin:17-jre-focal as frs_core
ARG DIR=/workspace/compreface
COPY --from=build ${DIR}/api/target/*.jar /home/app.jar
RUN yum upgrade -y; yum group install -y "Development Tools"; \
yum install -y wget tcl which zlib-devel git docbook-xsl libxslt graphviz; \
yum clean all

RUN mkdir -p /opt && cd /opt && git clone https://github.com/jemalloc/jemalloc.git \
&& mkdir /tmp/jprof && mkdir /tmp/nmt && mkdir /tmp/pmap \
&& mkdir /diagnostic

RUN cd /opt/jemalloc && git checkout -b stable-4 origin/stable-4
RUN cd /opt/jemalloc && ./autogen.sh --enable-prof
RUN cd /opt/jemalloc && make dist
RUN cd /opt/jemalloc && make
RUN cd /opt/jemalloc && make install

ENV LD_PRELOAD="/usr/local/lib/libjemalloc.so"
ENV MALLOC_CONF="prof_leak:true,prof:true,lg_prof_interval:25,lg_prof_sample:18,prof_prefix:/tmp/jeprof"

ENV DIAGNOSTIC_DIR /diagnostic
RUN mkdir -p "$DIAGNOSTIC_DIR"
COPY *.sh $DIAGNOSTIC_DIR/
ENTRYPOINT ["sh","-c","java $API_JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -jar /home/app.jar"]

FROM eclipse-temurin:17-jre-focal as frs_crud
Expand Down

0 comments on commit 4bac333

Please sign in to comment.