Immich is running out of memory while creating thumbnails (runaway memory) #7383

Closed
opened 2026-02-05 12:59:37 +03:00 by OVERLORD · 9 comments
Owner

Originally created by @parth017 on GitHub (Oct 1, 2025).

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.

Image

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

  1. With bigger library, go to Jobs
  2. Generate Thumbnails jobs >> All
  3. Observer the server memory usage and restart behavior.

Relevant log output


Additional information

No response

Originally created by @parth017 on GitHub (Oct 1, 2025). ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] 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. <img width="923" height="394" alt="Image" src="https://github.com/user-attachments/assets/31032435-d5a8-4b29-be4a-3cda230441a6" /> ### 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 - [x] Server - [ ] Web - [ ] Mobile ### Device make and model _No response_ ### Your docker-compose.yml content ```YAML not relevant, same as docker-compose from repo ``` ### Your .env content ```Shell not relevant ``` ### Reproduction steps 1. With bigger library, go to Jobs 2. Generate Thumbnails jobs >> All 3. Observer the server memory usage and restart behavior. ### Relevant log output ```shell ``` ### Additional information _No response_
Author
Owner

@droopanu commented on GitHub (Oct 1, 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

Image Image

Currently the only jobs running are the the face detection and facial recognition:

Image
@droopanu commented on GitHub (Oct 1, 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 <img width="1621" height="719" alt="Image" src="https://github.com/user-attachments/assets/5f096eed-92a6-491f-a09c-9554298ff0d4" /> <img width="1747" height="417" alt="Image" src="https://github.com/user-attachments/assets/d370a78b-71d6-4c49-80e2-497f96a0bd05" /> Currently the only jobs running are the the face detection and facial recognition: <img width="1091" height="631" alt="Image" src="https://github.com/user-attachments/assets/b0b67296-bcef-4d3b-8804-28930679230c" />
Author
Owner

@mertalev commented on GitHub (Oct 1, 2025):

Hi, which release did you upgrade from?

@mertalev commented on GitHub (Oct 1, 2025): Hi, which release did you upgrade from?
Author
Owner

@droopanu commented on GitHub (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.

@droopanu commented on GitHub (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.
Author
Owner

@parth017 commented on GitHub (Oct 1, 2025):

Hi, which release did you upgrade from?

upgraded from v1.143.1

@parth017 commented on GitHub (Oct 1, 2025): > Hi, which release did you upgrade from? upgraded from v1.143.1
Author
Owner

@mertalev commented on GitHub (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_PRELOAD line in the start script until that's resolved.

@mertalev commented on GitHub (Oct 1, 2025): It seems that Trixie uses a buggy alpha release of libmimalloc, which has [relevant bug fixes](https://github.com/microsoft/mimalloc?tab=readme-ov-file#releases) 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.
Author
Owner

@parth017 commented on GitHub (Oct 1, 2025):

can we not revert this to use v2 meanwhile?

38226fd240

@parth017 commented on GitHub (Oct 1, 2025): can we not revert this to use v2 meanwhile? https://github.com/immich-app/immich/commit/38226fd24041b2e97a0c77124cf4f946824d0a99
Author
Owner

@mertalev commented on GitHub (Oct 1, 2025):

Setting that to 2 is no different than commenting it out. It just doesn't use libmimalloc in either case.

@mertalev commented on GitHub (Oct 1, 2025): Setting that to 2 is no different than commenting it out. It just doesn't use libmimalloc in either case.
Author
Owner

@parth017 commented on GitHub (Oct 1, 2025):

Setting that to 2 is no different than commenting it out. It just doesn't use libmimalloc in either case.

Got it

@parth017 commented on GitHub (Oct 1, 2025): > Setting that to 2 is no different than commenting it out. It just doesn't use libmimalloc in either case. Got it
Author
Owner

@G36maid commented on GitHub (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):
Image

@G36maid commented on GitHub (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): <img width="2880" height="1920" alt="Image" src="https://github.com/user-attachments/assets/adc1f3f3-6b7f-4572-be9d-f2c2e867f91f" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#7383