2025-05-09, 12:03 PM
I do have the same problem that it increases until OOM.
For the time being I added a systemd timer to restart the docker container every 30minutes, so it doesn't hog all the memory and hangs the server (since the server also hosts DNS and other services inside the network).
On investigation it seems like it starts a jellyfin thread every other second[1]
inside the docker logs there is nothing from the time it says it started until the OOM[2]
No trickplay enable on any library and the following plugins enabled[3]
With enabled debug logs it looks like it does try to check the Scheduled Tasks all the time it increases the PID count[4]. Maybe the threads aren't closed after the check which contributed to the memory leak.
Happy to give you need more information if needed.
[1]
# while true; do docker stats --no-stream jellyfin; sleep 5; done
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 1.00% 304.1MiB / 3.501GiB 8.48% 0B / 0B 201kB / 213MB 832
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 2.68% 304.5MiB / 3.501GiB 8.49% 0B / 0B 201kB / 213MB 839
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 0.79% 304.8MiB / 3.501GiB 8.50% 0B / 0B 201kB / 213MB 844
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 1.65% 305.1MiB / 3.501GiB 8.51% 0B / 0B 201kB / 213MB 850
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 0.82% 305.7MiB / 3.501GiB 8.53% 0B / 0B 201kB / 213MB 859
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 1.81% 306MiB / 3.501GiB 8.54% 0B / 0B 201kB / 213MB 864
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 0.98% 306.4MiB / 3.501GiB 8.55% 0B / 0B 201kB / 213MB 870
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 0.80% 306.6MiB / 3.501GiB 8.55% 0B / 0B 201kB / 213MB 875
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 1.78% 306.9MiB / 3.501GiB 8.56% 0B / 0B 201kB / 213MB 880
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 0.89% 307.3MiB / 3.501GiB 8.57% 0B / 0B 201kB / 213MB 887
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 1.60% 307.2MiB / 3.501GiB 8.57% 0B / 0B 201kB / 213MB 892
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 0.87% 307.5MiB / 3.501GiB 8.58% 0B / 0B 201kB / 213MB 898
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 1.17% 307.7MiB / 3.501GiB 8.58% 0B / 0B 201kB / 213MB 901
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 0.89% 307.9MiB / 3.501GiB 8.59% 0B / 0B 201kB / 213MB 905
[2]
[..]
Emby.Server.Implementations.ApplicationHost: Core startup complete
Main: Startup complete 0:00:36.9432776
[3]
Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: AniDB 10.0.0.0
Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: AniList 11.0.0.0
Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: TMDb 10.10.6.0
Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: Studio Images 10.10.6.0
Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: OMDb 10.10.6.0
Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: MusicBrainz 10.10.6.0
Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: AudioDB 10.10.6.0
[4]
[11:58:26] [INF] [64] Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor: Executing ObjectResult, writing value of type 'Jellyfin.Api.Controllers.ScheduledTasksController+<GetTasks>d__2'.
[11:58:26] [INF] [64] Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker: Executed action Jellyfin.Api.Controllers.ScheduledTasksController.GetTasks (Jellyfin.Api) in 3.0568ms
[11:58:26] [INF] [64] Microsoft.AspNetCore.Routing.EndpointMiddleware: Executed endpoint 'Jellyfin.Api.Controllers.ScheduledTasksController.GetTasks (Jellyfin.Api)'
[11:58:26] [INF] [64] Microsoft.AspNetCore.Hosting.Diagnostics: Request finished HTTP/1.1 GET http://192.168.1.31:8096/ScheduledTasks?IsEnabled=true - 200 null application/json; charset=utf-8 5.6719ms
[11:58:30] [INF] [68] Microsoft.AspNetCore.Hosting.Diagnostics: Request starting HTTP/1.1 GET http://192.168.1.31:8096/ScheduledTasks?IsEnabled=true - null null
[11:58:30] [INF] [68] Microsoft.AspNetCore.Routing.EndpointMiddleware: Executing endpoint 'Jellyfin.Api.Controllers.ScheduledTasksController.GetTasks (Jellyfin.Api)'
[11:58:30] [INF] [68] Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker: Route matched with {action = "GetTasks", controller = "ScheduledTasks"}. Executing controller action with signature System.Collections.Generic.IEnumerable
[11:58:32] [INF] [69] Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor: Executing ObjectResult, writing value of type 'Jellyfin.Api.Controllers.ScheduledTasksController+<GetTasks>d__2'.
[11:58:32] [INF] [69] Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker: Executed action Jellyfin.Api.Controllers.ScheduledTasksController.GetTasks (Jellyfin.Api) in 11.8148ms
[11:58:32] [INF] [69] Microsoft.AspNetCore.Routing.EndpointMiddleware: Executed endpoint 'Jellyfin.Api.Controllers.ScheduledTasksController.GetTasks (Jellyfin.Api)'
[11:58:32] [INF] [69] Microsoft.AspNetCore.Hosting.Diagnostics: Request finished HTTP/1.1 GET http://192.168.1.31:8096/ScheduledTasks?IsEnabled=true - 200 null application/json; charset=utf-8 14.4339ms
[11:58:36] [INF] [73] Microsoft.AspNetCore.Hosting.Diagnostics: Request starting HTTP/1.1 GET http://192.168.1.31:8096/ScheduledTasks?IsEnabled=true - null null
[11:58:36] [INF] [73] Microsoft.AspNetCore.Routing.EndpointMiddleware: Executing endpoint 'Jellyfin.Api.Controllers.ScheduledTasksController.GetTasks (Jellyfin.Api)'
[11:58:36] [INF] [73] Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker: Route matched with {action = "GetTasks", controller = "ScheduledTasks"}. Executing controller action with signature System.Collections.Generic.IEnumerable
For the time being I added a systemd timer to restart the docker container every 30minutes, so it doesn't hog all the memory and hangs the server (since the server also hosts DNS and other services inside the network).
On investigation it seems like it starts a jellyfin thread every other second[1]
inside the docker logs there is nothing from the time it says it started until the OOM[2]
No trickplay enable on any library and the following plugins enabled[3]
With enabled debug logs it looks like it does try to check the Scheduled Tasks all the time it increases the PID count[4]. Maybe the threads aren't closed after the check which contributed to the memory leak.
Happy to give you need more information if needed.
[1]
# while true; do docker stats --no-stream jellyfin; sleep 5; done
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 1.00% 304.1MiB / 3.501GiB 8.48% 0B / 0B 201kB / 213MB 832
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 2.68% 304.5MiB / 3.501GiB 8.49% 0B / 0B 201kB / 213MB 839
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 0.79% 304.8MiB / 3.501GiB 8.50% 0B / 0B 201kB / 213MB 844
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 1.65% 305.1MiB / 3.501GiB 8.51% 0B / 0B 201kB / 213MB 850
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 0.82% 305.7MiB / 3.501GiB 8.53% 0B / 0B 201kB / 213MB 859
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 1.81% 306MiB / 3.501GiB 8.54% 0B / 0B 201kB / 213MB 864
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 0.98% 306.4MiB / 3.501GiB 8.55% 0B / 0B 201kB / 213MB 870
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 0.80% 306.6MiB / 3.501GiB 8.55% 0B / 0B 201kB / 213MB 875
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 1.78% 306.9MiB / 3.501GiB 8.56% 0B / 0B 201kB / 213MB 880
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 0.89% 307.3MiB / 3.501GiB 8.57% 0B / 0B 201kB / 213MB 887
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 1.60% 307.2MiB / 3.501GiB 8.57% 0B / 0B 201kB / 213MB 892
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 0.87% 307.5MiB / 3.501GiB 8.58% 0B / 0B 201kB / 213MB 898
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 1.17% 307.7MiB / 3.501GiB 8.58% 0B / 0B 201kB / 213MB 901
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
744ff4e4d855 jellyfin 0.89% 307.9MiB / 3.501GiB 8.59% 0B / 0B 201kB / 213MB 905
[2]
[..]
Emby.Server.Implementations.ApplicationHost: Core startup complete
Main: Startup complete 0:00:36.9432776
[3]
Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: AniDB 10.0.0.0
Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: AniList 11.0.0.0
Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: TMDb 10.10.6.0
Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: Studio Images 10.10.6.0
Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: OMDb 10.10.6.0
Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: MusicBrainz 10.10.6.0
Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: AudioDB 10.10.6.0
[4]
[11:58:26] [INF] [64] Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor: Executing ObjectResult, writing value of type 'Jellyfin.Api.Controllers.ScheduledTasksController+<GetTasks>d__2'.
[11:58:26] [INF] [64] Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker: Executed action Jellyfin.Api.Controllers.ScheduledTasksController.GetTasks (Jellyfin.Api) in 3.0568ms
[11:58:26] [INF] [64] Microsoft.AspNetCore.Routing.EndpointMiddleware: Executed endpoint 'Jellyfin.Api.Controllers.ScheduledTasksController.GetTasks (Jellyfin.Api)'
[11:58:26] [INF] [64] Microsoft.AspNetCore.Hosting.Diagnostics: Request finished HTTP/1.1 GET http://192.168.1.31:8096/ScheduledTasks?IsEnabled=true - 200 null application/json; charset=utf-8 5.6719ms
[11:58:30] [INF] [68] Microsoft.AspNetCore.Hosting.Diagnostics: Request starting HTTP/1.1 GET http://192.168.1.31:8096/ScheduledTasks?IsEnabled=true - null null
[11:58:30] [INF] [68] Microsoft.AspNetCore.Routing.EndpointMiddleware: Executing endpoint 'Jellyfin.Api.Controllers.ScheduledTasksController.GetTasks (Jellyfin.Api)'
[11:58:30] [INF] [68] Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker: Route matched with {action = "GetTasks", controller = "ScheduledTasks"}. Executing controller action with signature System.Collections.Generic.IEnumerable
1[MediaBrowser.Model.Tasks.TaskInfo] GetTasks(System.Nullable
1[System.Boolean], System.Nullable1[System.Boolean]) on controller Jellyfin.Api.Controllers.ScheduledTasksController (Jellyfin.Api).
[11:58:30] [INF] [68] Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor: Executing ObjectResult, writing value of type 'Jellyfin.Api.Controllers.ScheduledTasksController+<GetTasks>d__2'.
[11:58:30] [INF] [68] Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker: Executed action Jellyfin.Api.Controllers.ScheduledTasksController.GetTasks (Jellyfin.Api) in 4.9223ms
[11:58:30] [INF] [68] Microsoft.AspNetCore.Routing.EndpointMiddleware: Executed endpoint 'Jellyfin.Api.Controllers.ScheduledTasksController.GetTasks (Jellyfin.Api)'
[11:58:30] [INF] [68] Microsoft.AspNetCore.Hosting.Diagnostics: Request finished HTTP/1.1 GET http://192.168.1.31:8096/ScheduledTasks?IsEnabled=true - 200 null application/json; charset=utf-8 10.4557ms
[11:58:32] [INF] [69] Microsoft.AspNetCore.Hosting.Diagnostics: Request starting HTTP/1.1 GET http://192.168.1.31:8096/ScheduledTasks?IsEnabled=true - null null
[11:58:32] [INF] [69] Microsoft.AspNetCore.Routing.EndpointMiddleware: Executing endpoint 'Jellyfin.Api.Controllers.ScheduledTasksController.GetTasks (Jellyfin.Api)'
[11:58:32] [INF] [69] Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker: Route matched with {action = "GetTasks", controller = "ScheduledTasks"}. Executing controller action with signature System.Collections.Generic.IEnumerable
1[MediaBrowser.Model.Tasks.TaskInfo] GetTasks(System.Nullable1[System.Boolean], System.Nullable
1[System.Boolean]) on controller Jellyfin.Api.Controllers.ScheduledTasksController (Jellyfin.Api).[11:58:32] [INF] [69] Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor: Executing ObjectResult, writing value of type 'Jellyfin.Api.Controllers.ScheduledTasksController+<GetTasks>d__2'.
[11:58:32] [INF] [69] Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker: Executed action Jellyfin.Api.Controllers.ScheduledTasksController.GetTasks (Jellyfin.Api) in 11.8148ms
[11:58:32] [INF] [69] Microsoft.AspNetCore.Routing.EndpointMiddleware: Executed endpoint 'Jellyfin.Api.Controllers.ScheduledTasksController.GetTasks (Jellyfin.Api)'
[11:58:32] [INF] [69] Microsoft.AspNetCore.Hosting.Diagnostics: Request finished HTTP/1.1 GET http://192.168.1.31:8096/ScheduledTasks?IsEnabled=true - 200 null application/json; charset=utf-8 14.4339ms
[11:58:36] [INF] [73] Microsoft.AspNetCore.Hosting.Diagnostics: Request starting HTTP/1.1 GET http://192.168.1.31:8096/ScheduledTasks?IsEnabled=true - null null
[11:58:36] [INF] [73] Microsoft.AspNetCore.Routing.EndpointMiddleware: Executing endpoint 'Jellyfin.Api.Controllers.ScheduledTasksController.GetTasks (Jellyfin.Api)'
[11:58:36] [INF] [73] Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker: Route matched with {action = "GetTasks", controller = "ScheduledTasks"}. Executing controller action with signature System.Collections.Generic.IEnumerable
1[MediaBrowser.Model.Tasks.TaskInfo] GetTasks(System.Nullable
1[System.Boolean], System.Nullable`1[System.Boolean]) on controller Jellyfin.Api.Controllers.ScheduledTasksController (Jellyfin.Api).