Many users reported high memory/RAM usage, some 8GB+.

In my case gone from 1.5GB+ to 400MB or less on Raspberry Pi 4.

Adding MALLOC_TRIM_THRESHOLD_=100000can make a big difference.

With Docker:
Add to your docker-compose.yml and docker compose down && docker compose up -d

...
environment:
  - MALLOC_TRIM_THRESHOLD_=100000
...

With systemd:
Edit /etc/default/jellyfin change the value of MALLOC_TRIM_THRESHOLD_ and restart the service

# Disable glibc dynamic heap adjustment
MALLOC_TRIM_THRESHOLD_=100000

Source: https://github.com/jellyfin/jellyfin/issues/6306#issuecomment-1774093928

Official docker,Debian,Fedora packages already contain MALLOC_TRIM_THRESHOLD_.
Not present on some docker images like linuxserver/jellyfin

Check is container (already) have the variable
docker exec -it jellyfin printenv | grep MALLOC_TRIM_THRESHO LD_

  • atzanteol
    link
    fedilink
    English
    arrow-up
    75
    ·
    edit-2
    2 days ago

    It’s bad form to just say “set this variable to this value” without any explanation about what that variable does and why that value helped.

    Your configuration may not work or may be detrimental for others.

      • ferret
        link
        fedilink
        English
        arrow-up
        10
        ·
        1 day ago

        The linked source also doesn’t explain what the env variable actually does or why it fixes anything.