You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Immich is running out of memory while creating thumbnails (runaway memory) #22515
I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.
Yes
The bug
While attempting to generate thumbnails for approximately 45,000 images stored on the server, the immich server repeatedly encounters memory shortages and restarts with the same issue again and again. Seems like the garbage collection is not working in the jobs as it should so memory usage keeps increasing until hitting max.
The OS that Immich Server is running on
Debian 12
Version of Immich Server
v1.144.1
Version of Immich Mobile App
v1.144.1
Platform with the issue
Server
Web
Mobile
Device make and model
No response
Your docker-compose.yml content
not relevant, same as docker-compose from repo
Your .env content
not relevant
Reproduction steps
With bigger library, go to Jobs
Generate Thumbnails jobs >> All
Observer the server memory usage and restart behavior.
I can confirm @parth017 assessment that this seems to be caused by Thumbnail Generation.
In my case it seems that facial recognition triggers a regeneration of the thumbnails and that causes the memory leak.
As soon as I pause the thumbnail generation job, the memory leak stops.
It seems that Trixie uses a buggy alpha release of libmimalloc, which has relevant bug fixes relating to freeing memory in its changelog since the 3.0.1 alpha. We can comment out the LD_PRELOAD line in the start script until that's resolved.
While attempting to generate thumbnails for approximately 180,000 images,
immich-server keeps consuming all my memory, eventually hitting OOM and restarting the container.
I'm deploying via Docker Compose on Arch rolling (kernel 6.12.49-1-lts), Immich v1.144.1.
Temporary workaround: I've limited the Docker memory to prevent impacting other services,
but the container still keeps restarting during thumbnail generation.
When limit to 6GB on 8GB VMs (Red is immich-server):
Activity
droopanu commentedon Sep 30, 2025
Hello,
I have noticed the same issue since upgrading to 1.144.1.
I upgraded around 10.20, and look at the memory hog afterwards
Currently the only jobs running are the the face detection and facial recognition:
mertalev commentedon Oct 1, 2025
Hi, which release did you upgrade from?
droopanu commentedon Oct 1, 2025
@mertalev from 1.143.1
I can confirm @parth017 assessment that this seems to be caused by Thumbnail Generation.
In my case it seems that facial recognition triggers a regeneration of the thumbnails and that causes the memory leak.
As soon as I pause the thumbnail generation job, the memory leak stops.
parth017 commentedon Oct 1, 2025
upgraded from v1.143.1
mertalev commentedon Oct 1, 2025
It seems that Trixie uses a buggy alpha release of libmimalloc, which has relevant bug fixes relating to freeing memory in its changelog since the 3.0.1 alpha. We can comment out the
LD_PRELOADline in the start script until that's resolved.parth017 commentedon Oct 1, 2025
can we not revert this to use v2 meanwhile?
38226fd
mertalev commentedon Oct 1, 2025
Setting that to 2 is no different than commenting it out. It just doesn't use libmimalloc in either case.
parth017 commentedon Oct 1, 2025
Got it
G36maid commentedon Oct 1, 2025
Same problem here.
While attempting to generate thumbnails for approximately 180,000 images,
immich-server keeps consuming all my memory, eventually hitting OOM and restarting the container.
I'm deploying via Docker Compose on Arch rolling (kernel 6.12.49-1-lts), Immich v1.144.1.
Temporary workaround: I've limited the Docker memory to prevent impacting other services,
but the container still keeps restarting during thumbnail generation.
When limit to 6GB on 8GB VMs (Red is immich-server):

maxi1134 commentedon Feb 14, 2026
This issue still seems present on v2.5.6
My instance causes its VM to crash daily, even tho it has 60GB allocated
maxi1134 commentedon Mar 5, 2026
This is still an issue
mertalev commentedon Mar 7, 2026
@maxi1134 Can you try setting
LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libmimalloc.so.3"(replace x86_64 with aarch64 if you're on arm64)?