Scheduled Task Causing Memory to Balloon

Server Version#: 1.19.5.3112 (Linux)
Player Version#: 4.34.3

Recently (about a week ago), memory utilization for my Plex server has begun ballooning during the Scheduled Task timeframe. It typically consumes from 200 MB to maybe a few GB, but when the Scheduled Tasks run, it balloons to 18 to 25 GB. This is particularly problematic for me because I am on a shared service which restarts my instance if my total consumed memory goes over a certain threshold.

I’ve unchecked all options under Settings -> Scheduled Tasks (e.g. Backup database every three days, Optimize database every week, etc.) and set the “Analyze audio tracks for loudness” option to never (under Settings -> Library). Even after disabling all known Scheduled Tasks, the issue still occurs. I am able to successfully run the Optimize Database and Clean Bundles task from Manage -> Troubleshooting without issues.

I can post logs if that can help with diagnosis, but would appreciate some guidance on sanitizing them. Thanks in advance for any suggestions.

Settings -> Library
Disable also the “Intro detection”.

Thanks for the suggestion. I’ve made the change and will update this thread.

Just tested toggling off and on that option and it does look like that task is the culprit. Would this be due a problem with specific media? In the dashboard popover, it said it was detecting the intro on a video that doesn’t have a specific intro. I have some recordings of “Classic Arts Showcase”, which is just a series of short videos of “classical” type performances one after another. Sort of like recording MTV videos (if they still play them).

  • Is it typical for memory usage to go up dramatically during intro detection?
  • Is there a way to prevent specific media from being scanned (more granularly than at the library level)?

OttoKerner: Thanks for pinpointing the cause.

It needs to extract the audio stream, convert it to wav, sample it down, analyze it and compare it to the other episodes in this season.

This requires at least quite a lot of temporary storage. It shouldn’t block much of the RAM per se. Can you identify the media info of the video file? If you can recreate the behavior, the developers would love to analyze the file and see what causes the RAM grabbing.

There is no “finer” toggle switch than on the library level.

OttoKerner,

Thanks for the troubleshooting suggestions. I’ve attached a sample of the Plex Media Server log from when the intro detections start. There are 3 files that are attempted to be processed before the server is rebooted due to memory usage being over the allowed threshold for my hosting provider. This happens on all the files:

Aug 02, 2020 17:03:47.089 [0x7f9ffdffb700] DEBUG - Signalling job ID 10426 with 9
Aug 02, 2020 17:03:47.089 [0x7f9ffdffb700] DEBUG - Media Analyzer: Background analysis completed in 1.3 seconds, removing 1 IDs
Aug 02, 2020 17:03:47.095 [0x7fa011201700] ERROR - MDE: video has neither a video stream nor an audio stream
Aug 02, 2020 17:03:47.095 [0x7fa011201700] ERROR - MDE: video has neither a video stream nor an audio stream
Aug 02, 2020 17:03:47.095 [0x7fa011201700] ERROR - IntroDetector: Failed to get a decision for: /data/plexmedia/tv-gd/Classic Arts Showcase/Classic Arts Showcase_KCETDT_2013_05_15_01_28_00-1.m4v
Aug 02, 2020 17:03:47.095 [0x7fa011201700] DEBUG - Job running: '/usr/lib/plexmediaserver/Plex Media Fingerprinter' '-raw' '-length' '-1' ''
Aug 02, 2020 17:03:47.096 [0x7fa011201700] DEBUG - Jobs: Starting child process with pid 10430
Aug 02, 2020 17:03:47.102 [0x7fa011201700] DEBUG - Killing job.

Running mediainfo against that file shows that the detailed info is not able to be extracted:

General
Complete name                            : Classic Arts Showcase_KCETDT_2013_05_15_01_28_00-1.m4v
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (mp42/isom/avc1)
File size                                : 2.08 GiB
IsTruncated                              : Yes

Some background: These files were originally recorded using Windows Media Center (.mts format?) and then converted with Handbrake to .m4v. You can see the type of content via their web stream:

http://www.classicartsshowcase.org/watch-classic-arts-showcase/

I’ve run mediainfo against some other Classic Arts Showcase files in the same directory and they do show complete mediainfo results. So not sure if the issue is due to the nature of the content, the way the files were converted/created, or an issue only with specific files without correct container information.

Let me know if there’s anything else I can do to help diagnose.

Plex Media Server.2.sample.log (19.0 KB)

Update: I removed the possibly corrupt files which were showing the limited mediainfo results. The Scheduled Tasks (with the intro detection option enabled) is still resulting in the ballooning memory utilization. Searching the logs, I see that the IntroDetector process goes through a few shows seemingly successfully. The “Detecting intros” activity goes to 95% in the logs and there is a “Updating part with ID=” line for each episode. When it gets to “Classic Arts Showcase”, it only logs up to 85% Detecting intros and then doesn’t show up again, though I didn’t see any errors.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.