alexbelgium / hassio-addons

My homeassistant addons
MIT License
1.36k stars 193 forks source link

πŸ› [Jellyfin] Memory leak #1361

Closed ShonP40 closed 2 months ago

ShonP40 commented 2 months ago

Description

I’ve been using this addon for about 2 weeks now after migrating my Jellyfin server from an older PC and noticed that my memory usage slowly creeps up until HAOS basically decides to kill the addon and restart it

Reproduction steps

1. Install the addon on an ARM64 device (don’t know if x86 has the same issue)
2. Configure the server
3. Add some media
4. Leave the server running for a few days
5. Memory usage will go up until HAOS kills it (I have 3GB free out of 8 and Jellyfin managed to use up to 2GB before being killed)

Addon Logs

https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    0
User GID:    0
───────────────────────────────────────

[custom-init] No custom files found, skipping...
[23:36:29] [INF] [1] Main: Jellyfin version: 10.8.13
[23:36:29] [INF] [1] Main: Environment Variables: ["[JELLYFIN_LOG_DIR, /config/addons_config/jellyfin/log]", "[JELLYFIN_CACHE_DIR, /config/addons_config/jellyfin/cache]", "[JELLYFIN_CONFIG_DIR, /config/addons_config/jellyfin]", "[JELLYFIN_WEB_DIR, /config/addons_config/jellyfin/web]", "[JELLYFIN_DATA_DIR, /config/addons_config/jellyfin/data]"]
[23:36:29] [INF] [1] Main: Arguments: ["/usr/lib/jellyfin/bin/jellyfin.dll", "--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg"]
[23:36:29] [INF] [1] Main: Operating system: Linux
[23:36:29] [INF] [1] Main: Architecture: Arm64
[23:36:29] [INF] [1] Main: 64-Bit Process: True
[23:36:29] [INF] [1] Main: User Interactive: True
[23:36:29] [INF] [1] Main: Processor count: 4
[23:36:29] [INF] [1] Main: Program data path: /config/addons_config/jellyfin/data
[23:36:29] [INF] [1] Main: Web resources path: /config/addons_config/jellyfin/web
[23:36:29] [INF] [1] Main: Application directory: /usr/lib/jellyfin/bin/
[23:36:29] [INF] [1] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Setting cache path: /config/addons_config/jellyfin/cache
[23:36:29] [INF] [1] Emby.Server.Implementations.ApplicationHost: Loading assemblies
[23:36:30] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly InfuseSync, Version=1.4.2.0, Culture=neutral, PublicKeyToken=null from /config/addons_config/jellyfin/data/plugins/InfuseSync_1.4.2.0/InfuseSync.dll
[23:36:30] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly LiteDB, Version=5.0.12.0, Culture=neutral
from /config/addons_config/jellyfin/data/plugins/Kodi Sync Queue_9.0.0.0/LiteDB.dll
[23:36:30] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly Jellyfin.Plugin.KodiSyncQueue, Version=9.0.0.0, Culture=neutral, PublicKeyToken=null from /config/addons_config/jellyfin/data/plugins/Kodi Sync Queue_9.0.0.0/Jellyfin.Plugin.KodiSyncQueue.dll
[23:36:30] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly Jellyfin.Plugin.OpenSubtitles, Version=19.0.0.0, Culture=neutral, PublicKeyToken=null from /config/addons_config/jellyfin/data/plugins/Open Subtitles_19.0.0.0/Jellyfin.Plugin.OpenSubtitles.dll
[23:36:30] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN addresses : [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
[23:36:30] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN exclusions : []
[23:36:30] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using LAN addresses: [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
[23:36:30] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using bind addresses: []
[23:36:30] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using bind exclusions: []
[23:36:34] [INF] [1] InfuseSync.Plugin: InfuseSync is starting.
[23:36:34] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: InfuseSync 1.4.2.0
[23:36:34] [INF] [1] Jellyfin.Plugin.KodiSyncQueue.KodiSyncQueuePlugin: KodiSyncQueue is starting...
[23:36:34] [INF] [1] Jellyfin.Plugin.KodiSyncQueue.Data.DbRepo: Creating DB Repository...
[23:36:34] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: Kodi Sync Queue 9.0.0.0
[23:36:34] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: Open Subtitles 19.0.0.0
[23:36:34] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: TMDb 10.8.13.0
[23:36:34] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: Studio Images 10.8.13.0
[23:36:34] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: OMDb 10.8.13.0
[23:36:34] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: MusicBrainz 10.8.13.0
[23:36:34] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: AudioDB 10.8.13.0
[23:36:34] [INF] [1] Main: Kestrel listening on Any IP4 Address
[23:36:35] [WRN] [1] Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager: No XML encryptor configured. Key {REDACTED} may be persisted to storage in unencrypted form.
[23:36:35] [INF] [1] Emby.Server.Implementations.ApplicationHost: Running startup tasks
[23:36:35] [INF] [1] InfuseSync.ScheduledTasks.HousekeepingTask: Infuse housekeeping task scheduled.
[23:36:35] [INF] [1] Jellyfin.Plugin.KodiSyncQueue.ScheduledTasks.RetentionTask: Retention task scheduled
[23:36:35] [INF] [1] Emby.Server.Implementations.ScheduledTasks.TaskManager: Daily trigger for Remove Old Cached Data set to fire at 2024-04-29 00:01:00.000 +03:00, which is 00:24:24.3492636 from now.
[23:36:35] [INF] [1] Emby.Server.Implementations.ScheduledTasks.TaskManager: Daily trigger for Remove Old Sync Data set to fire at 2024-04-29 00:01:00.000 +03:00, which is 00:24:24.3465058 from now.
[23:36:35] [INF] [1] Emby.Server.Implementations.ScheduledTasks.TaskManager: Daily trigger for Extract Chapter Images set to fire at 2024-04-29 02:00:00.000 +03:00, which is 02:23:24.3204781 from now.
[23:36:35] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Found ffmpeg version 5.1.4
[23:36:35] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available decoders: ["libdav1d", "av1", "h264", "hevc", "mpeg2video", "mpeg4", "msmpeg4", "vp8", "libvpx", "vp9", "libvpx-vp9", "aac", "ac3", "dca", "flac", "mp3", "truehd"]
[23:36:35] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available encoders: ["libx264", "h264_v4l2m2m", "libx265", "mpeg4", "msmpeg4", "libvpx", "libvpx-vp9", "aac", "libfdk_aac", "ac3", "dca", "flac", "libmp3lame", "libopus", "truehd", "libvorbis", "srt"]
[23:36:35] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available filters: ["hwupload_vaapi", "zscale", "alphasrc"]
[23:36:35] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: scale_cuda with option Output format (default "same") is not available
[23:36:35] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: tonemap_cuda with option GPU accelerated HDR to SDR tonemapping is not available
[23:36:35] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: tonemap_opencl with option bt2390 is not available
[23:36:36] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: overlay_opencl with option Action to take when encountering EOF from secondary input is not available
[23:36:36] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: overlay_vaapi with option Action to take when encountering EOF from secondary input is not available
[23:36:36] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available hwaccel types: ["drm"]
[23:36:36] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: FFmpeg: /usr/lib/jellyfin-ffmpeg/ffmpeg
[23:36:36] [INF] [1] Emby.Server.Implementations.ApplicationHost: ServerId: REDACTED
[23:36:36] [INF] [1] Emby.Server.Implementations.ApplicationHost: Executed all pre-startup entry points in 0:00:00.3841546
[23:36:36] [INF] [1] Emby.Server.Implementations.ApplicationHost: Core startup complete
[23:36:37] [INF] [8] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /share/Jellyfin/Demos
[23:36:37] [INF] [10] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /share/Jellyfin/Shows
[23:36:37] [INF] [8] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /share/Jellyfin/Movies
[23:36:37] [INF] [1] Emby.Server.Implementations.ApplicationHost: Executed all post-startup entry points in 0:00:00.3824187
[23:36:37] [INF] [1] Main: Startup complete 0:00:08.0834177
[23:36:37] [WRN] [8] Microsoft.EntityFrameworkCore.Model.Validation: The entity type 'AccessSchedule' is configured to use schema 'jellyfin', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[23:36:37] [WRN] [8] Microsoft.EntityFrameworkCore.Model.Validation: The entity type 'ActivityLog' is configured to use schema 'jellyfin', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[23:36:37] [WRN] [8] Microsoft.EntityFrameworkCore.Model.Validation: The entity type 'CustomItemDisplayPreferences' is configured to use schema 'jellyfin', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[23:36:37] [WRN] [8] Microsoft.EntityFrameworkCore.Model.Validation: The entity type 'DisplayPreferences' is configured to use schema 'jellyfin', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[23:36:37] [WRN] [8] Microsoft.EntityFrameworkCore.Model.Validation: The entity type 'HomeSection' is configured to use schema 'jellyfin', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[23:36:37] [WRN] [8] Microsoft.EntityFrameworkCore.Model.Validation: The entity type 'ImageInfo' is configured to use schema 'jellyfin', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[23:36:37] [WRN] [8] Microsoft.EntityFrameworkCore.Model.Validation: The entity type 'ItemDisplayPreferences' is configured to use schema 'jellyfin', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[23:36:37] [WRN] [8] Microsoft.EntityFrameworkCore.Model.Validation: The entity type 'Permission' is configured to use schema 'jellyfin', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[23:36:37] [WRN] [8] Microsoft.EntityFrameworkCore.Model.Validation: The entity type 'Preference' is configured to use schema 'jellyfin', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[23:36:37] [WRN] [8] Microsoft.EntityFrameworkCore.Model.Validation: The entity type 'ApiKey' is configured to use schema 'jellyfin', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[23:36:37] [WRN] [8] Microsoft.EntityFrameworkCore.Model.Validation: The entity type 'Device' is configured to use schema 'jellyfin', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[23:36:37] [WRN] [8] Microsoft.EntityFrameworkCore.Model.Validation: The entity type 'DeviceOptions' is configured to use schema 'jellyfin', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[23:36:37] [WRN] [8] Microsoft.EntityFrameworkCore.Model.Validation: The entity type 'User' is configured to use schema 'jellyfin', but SQLite does not support schemas. This configuration will be ignored by the SQLite provider.
[ls.io-init] done.
[23:36:37] INFO: Starting NGinx...
[23:36:38] [INF] [10] Emby.Server.Implementations.ScheduledTasks.TaskManager: StartupTrigger fired for task: Update Plugins
[23:36:38] [INF] [10] Emby.Server.Implementations.ScheduledTasks.TaskManager: Queuing task PluginUpdateTask
[23:36:38] [INF] [11] Emby.Server.Implementations.ScheduledTasks.TaskManager: Executing Update Plugins
[23:36:41] [INF] [11] Emby.Server.Implementations.ScheduledTasks.TaskManager: Update Plugins Completed after 0 minute(s) and 2 seconds
[23:36:41] [INF] [11] Emby.Server.Implementations.ScheduledTasks.TaskManager: ExecuteQueuedTasks
[23:37:39] [INF] [31] Jellyfin.Networking.Manager.NetworkManager: Defined LAN addresses : [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
[23:37:39] [INF] [31] Jellyfin.Networking.Manager.NetworkManager: Defined LAN exclusions : []
[23:37:39] [INF] [31] Jellyfin.Networking.Manager.NetworkManager: Using LAN addresses: [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
[23:39:39] [INF] [22] Jellyfin.Networking.Manager.NetworkManager: Defined LAN addresses : [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
[23:39:39] [INF] [22] Jellyfin.Networking.Manager.NetworkManager: Defined LAN exclusions : []
[23:39:39] [INF] [22] Jellyfin.Networking.Manager.NetworkManager: Using LAN addresses: [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
[23:41:39] [INF] [18] Jellyfin.Networking.Manager.NetworkManager: Defined LAN addresses : [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]
[23:41:39] [INF] [18] Jellyfin.Networking.Manager.NetworkManager: Defined LAN exclusions : []
[23:41:39] [INF] [18] Jellyfin.Networking.Manager.NetworkManager: Using LAN addresses: [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]

Architecture

aarch64

OS

HAos

alexbelgium commented 2 months ago

Hi, my addon is just a front for the linuxserver's container ; you mighy have better support from their repo : https://github.com/linuxserver/docker-jellyfin/issues

An alternative (that I use for resource intensive addons) is to create an automation that restarts such addons daily during the night... Not solving the issue but preventing a lot ;-)

ShonP40 commented 2 months ago

Alright, thanks anyways