Jellyfin Forum
High RAM usage - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: High RAM usage (/t-high-ram-usage)



High RAM usage - MaxPuig - 2023-07-14

My RAM usage on my Pi is pretty high. I attach an image of htop command, sorted by ram usage, where you can see what the cause might be.

I'm not streaming any content, and I haven't for a few days.

What could be the issue? Maybe ffmpeg?

RAM usage drops significantly (<1GB) after restarting my Raspberry Pi.

   


RE: High RAM usage - TheDreadPirate - 2023-07-14

Check the server logs. It may be scanning your library. Chapter image extraction, maybe?


RE: High RAM usage - MaxPuig - 2023-07-14

I have hundreds of logs which say the following:
Note: 192.168.1.37 is an Android phone which has never accessed Jellyfin.

--- End of stack trace from previous location ---
at Rssdp.Infrastructure.SsdpCommunicationsServer.SendFromSocket(ISocket socket, Byte[] messageData, IPEndPoint destination, CancellationToken cancellationToken)
[2023-07-13 23:59:13.909 +02:00] [ERR] Error sending socket message from "192.168.1.37" to "239.255.255.250:1900"
System.Net.Sockets.SocketException (101): Network is unreachable
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.CreateException(SocketError error, Boolean forAsyncThrow)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.SendToAsync(Socket socket, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.SendToAsync(ReadOnlyMemory1 buffer, SocketFlags socketFlags, EndPoint remoteEP, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.BeginSendTo(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags, EndPoint remoteEP, AsyncCallback callback, Object state)
at Emby.Server.Implementations.Net.UdpSocket.SendToAsync(Byte[] buffer, Int32 offset, Int32 bytes, IPEndPoint endPoint, CancellationToken cancellationToken)
at Rssdp.Infrastructure.SsdpCommunicationsServer.SendFromSocket(ISocket socket, Byte[] messageData, IPEndPoint destination, CancellationToken cancellationToken)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at Rssdp.Infrastructure.SsdpCommunicationsServer.SendFromSocket(ISocket socket, Byte[] messageData, IPEndPoint destination, CancellationToken cancellationToken)
at System.Linq.Enumerable.WhereSelectListIterator
2.MoveNext()
at System.Threading.Tasks.Task.WhenAll(IEnumerable1 tasks)
at Rssdp.Infrastructure.SsdpCommunicationsServer.SendMessageIfSocketNotDisposed(Byte[] messageData, IPEndPoint destination, IPAddress fromLocalIpAddress, CancellationToken cancellationToken)
at Rssdp.Infrastructure.SsdpCommunicationsServer.SendMulticastMessage(String message, Int32 sendCount, IPAddress fromLocalIpAddress, CancellationToken cancellationToken)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder
1.AsyncStateMachineBox`1.MoveNext(Thread threadPoolThread)
at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(IAsyncStateMachineBox box, Boolean allowInlining)
at System.Threading.Tasks.Task.RunContinuations(Object continuationObject)
at System.Threading.Tasks.Task.DelayPromise.CompleteTimedOut()
at System.Threading.TimerQueueTimer.Fire(Boolean isThreadPool)
at System.Threading.TimerQueue.FireNextTimers()
at System.Threading.UnmanagedThreadPoolWorkItem.ExecuteUnmanagedThreadPoolWorkItem(IntPtr callback, IntPtr state)
at System.Threading.UnmanagedThreadPoolWorkItem.ExecuteUnmanagedThreadPoolWorkItem(IntPtr callback, IntPtr state)
at System.Threading.UnmanagedThreadPoolWorkItem.System.Threading.IThreadPoolWorkItem.Execute()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
--- End of stack trace from previous location ---
at System.Threading.Tasks.TaskToApm.End[TResult](IAsyncResult asyncResult)
at Emby.Server.Implementations.Net.UdpSocket.<>c__DisplayClass21_0.<SendToAsync>b__0(IAsyncResult callbackResult)
--- End of stack trace from previous location ---
at Rssdp.Infrastructure.SsdpCommunicationsServer.SendFromSocket(ISocket socket, Byte[] messageData, IPEndPoint destination, CancellationToken cancellationToken)


RE: High RAM usage - TheDreadPirate - 2023-07-14

Its been over a decade since my networking class, so I had to double check this. 239.255.255.250 is a reserved IP range for multicasting. So your phone is multicasting something? Not sure if this is related to your memory usage.

Upload the full log to paste bin or something so we can look it over. This multicast log may be burying other jellyfin process logs.


RE: High RAM usage - MaxPuig - 2023-07-18

Here's the log file for today. https://pastebin.com/zmN0AP7h
I restarted the server because ram usage was pretty high. IP addresses from 100.x.x.x are from Tailscale (VPN).
After rebooting, I've seen that the ram usage goes up every time I enter a new movie/series information site. Here is an image where you can clearly see how it slowly goes up: https://imgur.com/a/TOCLdTv


RE: High RAM usage - TheDreadPirate - 2023-07-18

Most apps will hold on to memory even if it doesn't need it anymore until the OS tells the app otherwise (another app needs the memory). This shows up as persistently high memory usage.

After a reboot/JF restart my system uses about 800MB of memory. After a few days the overall memory usage climbs as high as 2.5GB. Most of that is JF.

I wouldn't be concerned about your level of memory usage. That is normal.

Something I noticed.

Code:
[2023-07-18 02:13:57.267 +02:00] [ERR] Error in metadata saver
System.UnauthorizedAccessException: Access to the path '/mnt/nas/Shows/Series EN/The Last of Us/tvshow.nfo' is denied.
....
[2023-07-18 02:13:58.289 +02:00] [ERR] UnauthorizedAccessException - Access to path "/mnt/nas/Shows/Series EN/DAVE 2020/DAVE (2020) Season 2 1080p/metadata/Dave (2020) S02E05 1080p.jpg" is denied. Will retry saving to "/var/lib/jellyfin/metadata/library/21/21e441c04e69668f21f129f74e101c48/poster.jpg"

Does Jellyfin have write permissions to your library directory? I'm assuming you have "Metadata saver" and "Save artwork into media folders" enabled.

I'm also seeing this a lot. Not sure what would be causing that.

Code:
[2023-07-18 02:15:55.960 +02:00] [ERR] Error getting external streams from "/var/lib/jellyfin/metadata/library/f6/f6d45d1c10742b8f1ea11b67c3303fea/Breathing Room 2008 1080p.eng.srt"
MediaBrowser.Common.FfmpegException: ffprobe failed - streams and format are both null.



RE: High RAM usage - MaxPuig - 2023-07-18

> Access to the path '/mnt/nas/Shows/Series EN/The Last of Us/tvshow.nfo' is denied.
tvshow.nfo does not exist on my NAS.

> Does Jellyfin have write permissions to your library directory?
No, it does not, just read permissions. I've tried multiple times to mount the drive with write permissions unsuccessfully.
The only time I can write files is if I use the “sudo” command.

> ffprobe failed - streams and format are both null.
Might be related to https://github.com/jellyfin/jellyfin/issues/8773
I just ended up deleting that .srt file. No idea if that will fix the issue.


RE: High RAM usage - TheDreadPirate - 2023-07-18

Pretty sure the default is R/W when mounting a drive. But what about folder/file permissions? Does the Jellyfin user have owner/group permissions to the folder your library is in?

What does /etc/fstab look like?