• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting Troubleshooting high memory usage (>10Gb idle)

    Pages (2): 1 2 Next »

     
    • 0 Vote(s) - 0 Average

    Troubleshooting high memory usage (>10Gb idle)

    volcs0
    Offline

    Junior Member

    Posts: 31
    Threads: 8
    Joined: 2023 Dec
    Reputation: 0
    Country:United States
    #1
    2024-07-26, 01:11 PM
    My Jellyfin is idling with a high RAM usage - see attached.
    Most of the time 10Gb-12Gb of RAM. Normally, I don't notice, but when other demands are put on the server, Jellyfin starts to glitch, and sometimes the whole system will seize up.

    UnRAID 6.12.4
    AMD Ryzen 5 7600 6-Core @ 3800 MHz
    32 GiB DDR5 

    lscr.io/linuxserver/jellyfin:latest

    I've not doing anything special with any configuration.

    How can I start chasing this down? I read about limiting Jellyfin RAM usage - not sure if that's the right approach.

    Thanks.


    Attached Files Thumbnail(s)
       
    Efficient_Good_5784
    Offline

    Community Moderator

    Posts: 1,167
    Threads: 3
    Joined: 2023 Jun
    Reputation: 50
    #2
    2024-07-26, 01:19 PM (This post was last modified: 2024-07-26, 01:25 PM by Efficient_Good_5784. Edited 2 times in total.)
    Most likely normal behavior, especially if you have a lot of content on your server. Jellyfin uses ram a lot to cache data.

    Some of the devs have been investigating for a possible memory leak, but even then if something like that is found and fixed, Jellyfin will still cache a lot of data into ram.

    Also, Jellyfin being a server, idling doesn't mean much. It's not supposed to release ram if nobody is using it. It's supposed to be running 24/7 waiting for a client to connect and stream, so having the cached data remain in ram is necessary for whenever a client decides to reconnect. It saves time from having to wait for the server to refetch the data again from the storage disks.

    And it being cached data, it's supposed to be released whenever any other application needs to use ram.
    toytown
    Offline

    Member

    Posts: 78
    Threads: 2
    Joined: 2023 Jun
    Reputation: 3
    #3
    2024-07-26, 01:36 PM
    I'm using the official Jellyfin docker with only the "Playback Reporting" plugin installed extra. Jellyfin has been up 14 days so far has streamed/transcoded multiple films and is using 1.3GB of ram, my movie collection is over 13000 films, although no chapter or trickplay images are enabled. So i don't think having a large library is the culprit, could be a bad plugin.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #4
    2024-07-26, 01:40 PM (This post was last modified: 2024-07-26, 01:43 PM by TheDreadPirate. Edited 1 time in total.)
    Are you able to break out the processes running in the container? Is there a library scan in progress? Trickplays being generated? Either can spawn a lot of ffmpeg processes and consume memory.

    In LSIO's image for 10.8.13 there was an issue where it did not honor the limit on the number of ffmpeg processes it can spawn when doing library scans/chapter image extraction. In my testing it spawned up to 200 ffmpeg processes and used 15GB of RAM. Like reserved RAM, not cache. I'm not sure if that also true for their 10.9 image.

    Also, can you list out the docker environment variables for the jellyfin container? Do you have this env variable set?

    MALLOC_TRIM_THRESHOLD_=131072
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    volcs0
    Offline

    Junior Member

    Posts: 31
    Threads: 8
    Joined: 2023 Dec
    Reputation: 0
    Country:United States
    #5
    2024-07-26, 03:21 PM
    (2024-07-26, 01:40 PM)TheDreadPirate Wrote: Are you able to break out the processes running in the container?  Is there a library scan in progress?  Trickplays being generated?  Either can spawn a lot of ffmpeg processes and consume memory.

    In LSIO's image for 10.8.13 there was an issue where it did not honor the limit on the number of ffmpeg processes it can spawn when doing library scans/chapter image extraction.  In my testing it spawned up to 200 ffmpeg processes and used 15GB of RAM.  Like reserved RAM, not cache.  I'm not sure if that also true for their 10.9 image.

    Also, can you list out the docker environment variables for the jellyfin container?  Do you have this env variable set?

    MALLOC_TRIM_THRESHOLD_=131072

    The only environment variables I have set are
    JELLYFIN_PublishedServerUrl and NVIDIA_VISIBLE_DEVICES

    How could I break out the processes running in the container? See attached for what I see in the container with top.

    This could be related to Trickplay, I guess. My library has about 2500 movies and 2000 TV shows. And on a daily basis, I'm only adding 1-2 new items at most.

    List of plugins attached.

    Thanks for the help and ideas.


    Attached Files Thumbnail(s)
           
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #6
    2024-07-26, 04:32 PM
    You set those two variables, but the container should come with its own. On the command line this command will list out all the environment variables, including any you added in the docker config.

    Code:
    sudo docker exec jellyfin env

    I don't know about Unraid, but top/htop/btop on the host should list all the processes spawned by a container. You could also open a bash shell into the container. The container may not have top installed, but the LSIO image of Jellyfin does allow you to install packages.

    Code:
    sudo docker exec -t jellyfin bash

    That should drop you in the container's shell. If top is not installed.

    Code:
    sudo apt install top
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    volcs0
    Offline

    Junior Member

    Posts: 31
    Threads: 8
    Joined: 2023 Dec
    Reputation: 0
    Country:United States
    #7
    2024-07-26, 04:55 PM
    (2024-07-26, 04:32 PM)TheDreadPirate Wrote: You set those two variables, but the container should come with its own.  On the command line this command will list out all the environment variables, including any you added in the docker config.

    Code:
    sudo docker exec jellyfin env

    I don't know about Unraid, but top/htop/btop on the host should list all the processes spawned by a container.  You could also open a bash shell into the container.  The container may not have top installed, but the LSIO image of Jellyfin does allow you to install packages.

    Code:
    sudo docker exec -t jellyfin bash

    That should drop you in the container's shell.  If top is not installed.

    Code:
    sudo apt install top

    See attached for top command and my environment variables


    Attached Files Thumbnail(s)
           
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #8
    2024-07-26, 05:01 PM (This post was last modified: 2024-07-26, 05:01 PM by TheDreadPirate. Edited 1 time in total.)
    That is not the correct env command.

    You have to run the env command I provided from the HOST and not inside the container.

    Also, wtf. 9.8G ffmpeg process?! I have never seen it use that much.

    Run this command and it should output the full ffmpeg command so we can see what that is doing.

    Code:
    ps -aux | grep ffmpeg
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    volcs0
    Offline

    Junior Member

    Posts: 31
    Threads: 8
    Joined: 2023 Dec
    Reputation: 0
    Country:United States
    #9
    2024-07-26, 05:09 PM
    (2024-07-26, 05:01 PM)TheDreadPirate Wrote: That is not the correct env command.

    You have to run the env command I provided from the HOST and not inside the container.

    Also, wtf.  9.8G ffmpeg process?!  I have never seen it use that much.

    Run this command and it should output the full ffmpeg command so we can see what that is doing.

    Code:
    ps -aux | grep ffmpeg

    See attached screenshots for ENV and FFMPEG.
    Thanks again for the help.


    Attached Files Thumbnail(s)
           
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #10
    2024-07-26, 05:22 PM
    First, add this to your environment variables in the docker config. It should trigger jellyfin/docker to more aggressively conserve memory.

    MALLOC_TRIM_THRESHOLD_=131072

    Does the terminal not word wrap? The rest of the command is cut off.

    Code:
    ps -aux | grep ffmpeg > ffmpeg.txt
    cat ffmpeg.txt
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Pages (2): 1 2 Next »

    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode