Jump to content


Photo

Transcoding causes Emby server restart - Memory Leak

Emby server transcoding restart crash memory leak

Best Answer henriquefer , 05 November 2019 - 07:40 AM

It seems that the issue was caused by internal network latency between my RPi4 and Nvidia Shield. So, now I have all machines connected through a good switch, and the connection is working faster and no issue so far.

 

Thank you for your attention.

I am going to perform further tests during the next days. I let you know if anything goes wrong. 

Go to the full post


  • Please log in to reply
39 replies to this topic

#1 henriquefer OFFLINE  

henriquefer

    Member

  • Members
  • 24 posts
  • Local time: 08:49 AM

Posted 27 June 2019 - 10:24 AM

Hi,

 

I have my Emby server on Shield TV, and everything works fine unless I want to transcode files bigger than ~2GB. The transcoding process causes the Shield to run out of memory (RAM) and it restarts the Emby Server. No error is displayed on logs since the restart is caused by the lack of memory (I checked that trough adb access to my Shield).

This problem occurs during conversion (sync) or transcoding during playback. 

 

I have already tried the following Emby versions:
4.1.1.0

4.2.0.18

4.2.0.19

4.2.0.20

 

You can check the transcoding log in attachment. 

 

Tips for developers: I don't know, but the -rtbufsize keyword for ffmpeg could limit the amount of RAM used in the process. Could this trick be an easy way to overcome this issue?

 

Thank you very much.

Attached Files



#2 ebr OFFLINE  

ebr

    Chief Bottle Washer

  • Administrators
  • 48178 posts
  • Local time: 03:49 AM

Posted 27 June 2019 - 10:55 AM

@softworkz



#3 embyciado OFFLINE  

embyciado

    Newbie

  • Members
  • 2 posts
  • Local time: 03:49 AM

Posted 01 July 2019 - 11:58 AM

A mi me sucede con archivos de menos de 1GB, teniendo una tvbox generica de 2GB de Ram a 1.5 Ghz de procesador



#4 henriquefer OFFLINE  

henriquefer

    Member

  • Members
  • 24 posts
  • Local time: 08:49 AM

Posted 01 July 2019 - 12:03 PM

I figured out the issue. The machine runs out of memory, and the server restarts. I rooted my Shield TV to increase swap, and now I am able to transcode with no issues. 



#5 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 142718 posts
  • Local time: 03:49 AM

Posted 01 July 2019 - 12:52 PM

Thanks for the feedback, although you shouldn't have to do that. @softworkz will be looking into this.

#6 henriquefer OFFLINE  

henriquefer

    Member

  • Members
  • 24 posts
  • Local time: 08:49 AM

Posted 01 July 2019 - 12:54 PM

Thanks for the feedback, although you shouldn't have to do that. @softworkz will be looking into this.

I know, but I tried some stuff on this weekend, and I was lucky increasing the available swap memory to avoid the server crash. I hope you can fix it soon. :)



#7 softworkz OFFLINE  

softworkz

    Advanced Member

  • Developers
  • 1902 posts
  • Local time: 09:49 AM

Posted 04 July 2019 - 05:32 PM

@henriquefer - Are you sure that it's ffmpeg consuming a high amount of memory? Have you used any tool to verify this?



#8 henriquefer OFFLINE  

henriquefer

    Member

  • Members
  • 24 posts
  • Local time: 08:49 AM

Posted 04 July 2019 - 06:39 PM

Hi. I think so because I checked it with top command on adb shell. The thing os that Shield has already few amount of free RAM, and 1GB of RAM required by the ffmpeg leads to Shield run out of memory. Moreover, I overcome the issue increasing swap to like 6GB.

#9 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 142718 posts
  • Local time: 03:49 AM

Posted 10 October 2019 - 01:07 AM

@henriquefer are you still running into this? Our 4.3 beta has an updated ffmpeg build if you'd like to try that. Thanks !



#10 henriquefer OFFLINE  

henriquefer

    Member

  • Members
  • 24 posts
  • Local time: 08:49 AM

Posted 01 November 2019 - 09:15 PM

I'm gonna try it. I let you know if it works, Thanks



#11 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 142718 posts
  • Local time: 03:49 AM

Posted 01 November 2019 - 09:21 PM

Great, thanks !



#12 henriquefer OFFLINE  

henriquefer

    Member

  • Members
  • 24 posts
  • Local time: 08:49 AM

Posted 03 November 2019 - 08:19 AM

Hey. The conversion works perfectly now.
However I am having another issue now. When I started any episode or movie, the playback freezes every 10-15 seconds.
My setup is a Nvidia Shield as server accessing files from a RPi4 (through samba) where I have mounted a rclone Google Drive drive.
Do you know some options that can be used to overcome this issue?

#13 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 142718 posts
  • Local time: 03:49 AM

Posted 03 November 2019 - 01:31 PM

We'd have to go over an example in detail. Thanks for the feedback.

#14 henriquefer OFFLINE  

henriquefer

    Member

  • Members
  • 24 posts
  • Local time: 08:49 AM

Posted 04 November 2019 - 06:28 AM

Hi,

 

You can find log files in attachment.

I am trying to watch the following file "/storage/DIETPI/Plexserver/TVShows/Legacies/Season 2/Legacies.S02E03.You.Remind.Me.of.Someone.I.Used.to.Know.REPACK.1080p.AMZN.WEB-DL.DDP5.1.H.264-KiNGS-iNC0GNiTO.mkv"

 

In this particular case, the playback does not freeze but it jumps several minutes. 

 

Thank you

 

Best regards

Attached Files



#15 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 142718 posts
  • Local time: 03:49 AM

Posted 04 November 2019 - 01:19 PM

What do you mean by that exactly?



#16 henriquefer OFFLINE  

henriquefer

    Member

  • Members
  • 24 posts
  • Local time: 08:49 AM

Posted 04 November 2019 - 01:21 PM

The episode is playing normally (during 18 minutes), and then, suddenly, it goes to minute 25 or something. 



#17 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 142718 posts
  • Local time: 03:49 AM

Posted 05 November 2019 - 12:51 AM

Is it consistent at the same spot each time?

#18 henriquefer OFFLINE  

henriquefer

    Member

  • Members
  • 24 posts
  • Local time: 08:49 AM

Posted 05 November 2019 - 07:40 AM   Best Answer

It seems that the issue was caused by internal network latency between my RPi4 and Nvidia Shield. So, now I have all machines connected through a good switch, and the connection is working faster and no issue so far.

 

Thank you for your attention.

I am going to perform further tests during the next days. I let you know if anything goes wrong. 


  • Luke likes this

#19 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 142718 posts
  • Local time: 03:49 AM

Posted 05 November 2019 - 11:44 AM

Thanks for the feedback !



#20 amyhimesama OFFLINE  

amyhimesama

    Newbie

  • Members
  • 2 posts
  • Local time: 09:49 AM

Posted 10 November 2019 - 06:03 PM

Hi,

 

I have my Emby server on Shield TV, and everything works fine unless I want to transcode files bigger than ~2GB. The transcoding process causes the Shield to run out of memory (RAM) and it restarts the Emby Server. No error is displayed on logs since the restart is caused by the lack of memory (I checked that trough adb access to my Shield).

This problem occurs during conversion (sync) or transcoding during playback. 

 

I have already tried the following Emby versions:
4.1.1.0

4.2.0.18

4.2.0.19

4.2.0.20

 

You can check the transcoding log in attachment. 

 

Tips for developers: I don't know, but the -rtbufsize keyword for ffmpeg could limit the amount of RAM used in the process. Could this trick be an easy way to overcome this issue?

 

Thank you very much.

 

 

 Tutuapp 9Apps ShowBox

I think so because I checked it with top command on adb shell. The thing os that Shield has already few amount of free RAM, and 1GB of RAM required by the ffmpeg leads to Shield run out of memory. Moreover, I overcome the issue increasing swap to like 6GB.


Edited by amyhimesama, 16 November 2019 - 04:50 PM.






Also tagged with one or more of these keywords: Emby, server, transcoding, restart, crash, memory, leak

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users