I don’t know where to start. I’ve been having this uncommon problem, where sometimes on my task manager I see “Plex Media Server.exe” eating up around 20% of my cpu.
This is not the transcoder.exe, as transcoder is only taking up 6% if active (got HW encoding on)
I’ve searched the forums and saw this post about old plugin bundles, and I’ve manually removed everything from my plugin folder (just old plugins like DVDOrder, webtools etc…)
I do not have preview thumbnails on, and my scheduled scans is not due (as its only between 2AM to 5AM as default)
I think its from PlexScriptHost.exe, and its tasking my CPU a lot.
I can provide logs if asked. I just don’t know what to do. Would love if someone could guide me.
I’ve narrowed the problem to when plex does a direct stream instead of direct play, and that’s only locally. I’m using the PC to play a movie, using logitech headset and when playing with stereo audio it direct plays everything.
when changing the audio to aac 5.1 (or even ac3 5.1) it shows transcoding to direct stream.
However, I’m seeing plex media server.exe racking up CPU, and it never stops! It averages at around 40% until I close my movie.
If I change quality to lower (and thats all playing locally on a PC), transcoding kicks in, and it only uses about 8% to 10% (using hardware accelerated encoding on).
I tested this also remotely, same behavior! This only happens with audio being chosen 5.1 and being direct stream.
The problem is not about transcoding, its about stuck in a loop, or a leak.
When changing from direct play to direct stream because of audio changing from stereo (aac) to 5.1, if subtitle is none (no subtitle playing), plex media server.exe would go up for a split second and come down, hitting max of 10% cpu usage and down to 0.5% roughly stabilizing, all less than a second.
Once I choose a subtitle when the media is direct streaming with 5.1 audio, plex media server.exe would spike up to 20% and stays around there.
Now the weirdest thing is I tried different methods.
first method I tried going into that subtitle file locally, while the media is playing with that specific subtitle file and spiking cpu, I opened the subtitle srt with notepad, closing it, and the PMS cpu goes down.
Most of the time it doesn’t work that method, so the other method I did was changing subtitles while the media is playing, then the PMS cpu goes down. This is a tedious method as I have to change the subtitle several times for it to stabilize.
If I choose subtitle none, it stabilizes but then if I choose my preferred subtitle, it spikes up and I have to keep changing subtitles until it goes down.
But if I start the media with audio 5.1 (direct stream not direct play), and have subtitle enabled, it will ALWAYS spike up the PMS cpu.
If I start the media without any subtitles first, and while the media is playing and change subtitle, it stabilizes eventually.
I’ve logged when this happens, and yet I did not understand what the log is saying!
at 16:48:20.580 (16hrs 48mins 20secs 580ms) time is when I chose a subtitle (ara subtitles) while the media was playing with 5.1 audio (direct streaming)
at 16:50:21.800 (approximately) changed subtitle to none.
I have also logged the previous timings when I tried to stabilize (lower PMS cpu usage back to normal 0.5% from 25% cpu) while changing between 2 subtitles (eng and ara)
until its reached to 16:48 which is the first log I attached.
EDIT: The only temporary solution to PMS CPU issue is to change quality from original to any other (even locally) just so the plex transcoder to kick in. When it kicks in, the PMS cpu goes all the way down to 0.5% (approx).
EDIT 2: Plex is now going up to 65% to 75% if left for longer than 20mins. This is confirmed with remote access. This is also becoming random, so ignore my first method of altering my subtitle directly in my folder.
Just saw your thread. The SRT being converted is due to a issue some client shave playing back subtitles when the video/audio is being direct streamed. The spike you see is normal, as this conversion does take some CPU power temporarily. However, the load should drop very quickly.
I haven’t noticed this issue, but let me see if I can reproduce.
I can 100% reproduce the problem. But I’m not 100% sure if its caused only from the subtitle.
I chose a media which has both audio AAC stereo and AAC 5.1.
Choosing stereo with SRT sub is perfect. Choosing AAC 5.1 with subtitles, PMS would be stuck on CPU usage and will increase the longer I leave it on.
I do not if this is relevant or not, but kept testing. If I had a media which AC3 5.1, PMS would downmix it to stereo, and if the subtitle was converted to ASS (from srt) then PMS would hug the CPU.
Playing anything with audio Stereo and subtitles in SRT, no problem.
I also tested different devices, Samsung TV (Tizen), even if using aac stereo, would convert srt to ASS and PMS would rack up to 74% (same as the image posted previously)
Exactly. Covnerting the audio from 5.1 to stereo is direct streaming. With the original stereo, the file can be direct played. The conversion of the subtitles from srt to ass is done by the main PMS process, so the increase in load is expected, but it shouldn’t stay that way. There may be a memory leak somewhere.
You’ll need to check if the stream is being direct played or direct streamed. Even with stereo, there can be situations where the stream cannot be direct played. It is not a matter of the audio, but the type of streaming mechanism used. A conversion can also happen if the original SRT is not properly encoded as utf-8. You can try converting the file utf-8 and see if you get the same issue.
Actually all my SRT subtitles are in UTF-8, as my preferred language only works with utf-8 (alongside english subs that are also in UTF-8, But I have also tested both types UTF-8 and ANSI)
As long as the subtitle is not converted to ASS, PMS would not use CPU, as you said, it will only temporarily spike up to 20% or so for a second or two and drops down.
But if the subtitle convert to ASS, it will first start at 19-20%, and around 20+mins, it starts to increase in CPU Usage.
Subtitle will convert SRT to ASS if the audio chosen is 5.1, if its stereo then subtitle will stay as SRT.
EDIT: Sorry I didn’t make sense here, as long as subtitle isn’t converted its good, and also if it direct streams it means subtitle is converting to ASS. I meant that if plex tries to play audio in chosen 5.1, I dunno why subtitle converts to ASS, but in stereo, subtitle stays in SRT and it direct plays. Hope that makes any sense
Samsung TV (Tizen) is the only exception where even in stereo, it converts SRT to ASS, and PMS racks up on CPU.
I can re-produce the problem and log the times and upload all plex logs if you would like to see, as I couldn’t really pin point where exactly was this leak. Or why was it happening.
@anon18523487 Any updates? Have you tried re-producing the problem?
So far this is affecting plex web app (google chrome and firefox tested) where using 5.1 audio with external SRT subtitle has a memory leak as its converting to ASS
Also Samsung TV OS uses ASS subtitle.
Any device that uses ASS subtitle will have a leak and causes CPU to slowly rise until I manually terminate it.
I’ve tried reverting to older PMS version, but so far all 1.15.xxxx versions has the same, I believe versions 1.14.xxxx are stable, for me that is as I’m now using version 1.14.1.5488 (the last of version 1.14 before 1.15).
EDIT:
I have found an older post similar to my problem and its still open here, I believe the problem is global related to recent PMS version.
I did try a few movies I have with SRT subs and getting them to convert to ASS. I cannot reproduce this memory leak.
This is the part that’s confusing me. If there was a leak it should happen all the time. If it only happens sometimes, then there is either a race condition I can’t reproduce or there is something else on your system that might be interfering.
Have you tried disabling Tautulli? I’ve seen a few reports where it can interfere with PMS.
@MovieFan.Plex Sorry took so long to reply, I actually used another PC (my gaming PC windows 10) and installed PMS to perform the test again.
I also took your advise about removing Tautulli and try it, at first I thought it really worked, but continued testing before jumping to conclusion.
Now i’ve used the newest beta version as of now its 1.16.2.1297-4b7ace214
At first it was great, no problems!
Even though my PMS PC at the time of posting here my problem was on version “1.16.1.1273”).
I then used Tautulli on my gaming pc alongside PMS, memory leak appeared. I thought that was the problem. (I didn’t do a lot of tests, just a one time playing media).
Went back to my dedicated PMS PC, updated to the latest 1.16.2.1297 version beta, there’s no memory leak, at first. This is while Tautulli running as I did not yet remove it.
Even with or without Tautulli activated, same result, but then when I tried rewinding the movie back 2x to 4x, memory leak appeared.
Closed/disabled Tautulli, memory leak still there.
I uninstalled PMS and everything alongside it (Tautulli, Ombi), used my gaming PC for further tests, when first installing PMS on any PC, everything is perfect, once the memory leak starts and CPU rises, that’s it, it will always show memory leak.
to conclude exactly what I experienced (and i’m still confused what exactly is happening):
A fresh install of PMS, a re-install of PMS or an upgraded version to newer PMS will not show any memory leak (3 times tested this)
After playing your 3rd to 5th media, rewinding back 2x to 4x times, the plex media server on task manager would get stuck on 18-20% CPU usage (memory leak, percentage differs between CPU, as my gaming PC has i7 8700k overclocked shows CPU gets stuck around 12% instead of my intel NUC 20%).
once the memory leak appears, it will always appear on any media/movie played afterwards until uninstall/re-install/updating PMS version.
When the memory leak appears, a further rewind or forwarding the movie would increase the memory leak.
These tests are all used on movies having AC3 or DTS audio chosen with English SRT Subtitle being converted to ASS by PMS while Tautulli is running, when I saw memory leak, I removed tautulli, but that did not make any difference.
Tests were on my intel Skullcanyon NUC i7 Windows 10 Pro PC (dedicated PMS) and my Gaming PC (a test to PMS) that has i7 8700k CPU with GTX 1080Ti GPU.
TL:DR;
This kind of bug is confusing as hell! It doesn’t show it at first, it may come up randomly, a fresh install of PMS or updating to a new version of PMS would reset any memory leak at first, and shows everything normal. Once the memory leak is there after several movies later, it will always show.
I cannot confirm or deny whether Tautulli program has any affect, as this kind of bug is the most complicated thing I have ever seen/faced.
I can confirm that once the memory leak is there, even if I removed every trace of any other program excluding PMS, it will always be there. It’s like a mythical creature that has no trace, but once the monster is awoken, it wreaks havoc and is always there!
PS: I’m open to any suggestions here. I don’t envy the developers right now.
It feels like PMS is stuck on something, everytime I try to rewind more and more, it stacks up. So I tried to rewind 6x back, for the sake of testing, here’s the result:
I can also go back until PMS CPU hits around 70%, that’s the max I ever saw it hit, anymore rewinding would rarely go back to stable though, back to normalizing.
The funny thing is, holding down right keyboard arrow (forwarding) randomly for about 2seconds, it will normalize the CPU back to almost 0.5%.
I’m mentioning using keyboard arrows, its because when using the mouse to manually click on where I want the movie to go to, it will not ramp up the CPU, but will be hovering around 18%-20%. But using keyboard to rewind, CPU ramps up, stacking it to max 70%.
All timings are in GMT+3 (UTC+3). These timings are approximate.
13:36pm: Movie started playing on app.plex.tv, the subtitle was chosen (English external SRT), however the subtitle did not appear (no subtitle shown when movie was playing, but dashboard shows the subtitle, and SRT was getting converted to ASS), hence the PMS CPU here was in low 1% to 0.5%
13:38pm 1x rewind 18% CPU, subtitle did show.
13:39pm 3x rewind 59% CPU, subtitle did show.
13:40pm 4x rewind 60% CPU, subtitle did show.
13:41pm closed the running movie/terminated the stream.
Gonna include the Movie info XML done in pastebin, hope it helps. Although this happens to any media with more than 2 channel audio and needs srt to be converted to ass. https://pastebin.com/E43r4LLh
Plex Web Client (google chrome) Version 3.106.3
Plex Media Server Version 1.16.2.1297