Configure PHP 8.5 jemalloc to reduce RAM usage.

119.128.***.***
8

I also wrote it on the blog, so I'll post it here too.


There is a library called Jemalloc, which is a memory allocator that reduces locks in a multi-threading environment and

reduces memory fragmentation.

In php 8.5, the bug related to specifying an external memory allocator was fixed, so we can now use jemalloc.

(Thanks to the Psalm team at Biomed)


I learned about it while reading the psalm (php static analyzer) blog, and it says that psalm performance has improved by 30%.

According to the techempower benchmark, Ruby also uses jemalloc to reduce RAM usage and improve performance.



https://storck.io/posts/psa-switch-ruby-docker-to-jemalloc-now/

In Ruby, fragmentation is definitely reduced, reducing RAM usage.


How to specify in Docker 

# Use Jemalloc for optimize
RUN apt install libjemalloc2 # Installation based on Ubuntu

ENV LD_PRELOAD= libjemalloc.so.2 # Setting in PHP
로그인한 회원만 댓글 등록이 가능합니다.

개발한당

KR | ID | EN
  • IDR
  • KOR
8.34 -0.01

2026.07.10 KEB 하나은행 고시회차 1436회

다가오는 한인 행사일정

  • 등록 된 일정이 없어요!