Server Version#: 1.19.3.2852
Player Version#: N/A
Tuner Make/Model: HD Homerun Quattro
Guide/Lineup name: N/A
Using XMLTV?: Yes
Channel number/Name: N/A
I feel this has been happening for a number of versions now (maybe since the first v1.19.x version, I don’t recall seeing it happen on v1.18.x). What seems to happen is when Plex server accesses my tuner the memory usage of the server doubles, from ~2GB to ~4GB (8GB total ram on my Synology NAS).
At this time I simply restarted my Plex server to set the baseline and then within the server settings navigated into the [Live TV & DVR] menu item then clicked into the ‘## enabled’ channels link to show the list of channels for my tuner. There’s a small pause as I assume Plex server is querying the tuner and that is exactly when the memory usage jumps up.
Note that the actions I performed did not involve any player/client activity at all.
It’s the original 8GB total - I did mention that above.
The other applications on the NAS are minimal (only had it a couple of months now so haven’t tried much). Other than the ‘stock’ DSM applications, I have Docker (with 3 containers, none reporting more than 310MB memory used) and Synology Moments.
DSM task manager currently looks like this, if that’s of any use:
Just to check - by stop and restart I do that from DSM package manager (I did this before)?
And then what would you like me to try and do to increase the memory usage? Various player/client activity - direct play, forced transcode, etc?
Start playing some content (on web browser and then also android phone) - forced transcoding (hw) down to a lower resolution (note: audio was not transcoding). A very small increase in memory usage when starting the 2nd stream (shown at around 38seconds on the graph):
Stop those playing. Start playing some higher quality content, again forced transcoding to a lower resolution, hardware transcode for the video, and this time audio needed transcoding.
To test Live TV activity, I restarted the server, started 2 streams of Live TV (one web browser and one android phone) and that showed no large increase in memory (remained in mid-20%'s).
Then in the settings again I went to the [Live TV & DVR] section, clicked into ‘XX channels’ enabled and again that’s when the memory usage increases dramatically, as before.
I am looking into memory leak issue and I can send you a build with some extra logging for memory use by the plex media server process -
For channel mapping we do have in memory lists of tuner channels and lineup channels for matching but i would not expect that to use up 2gb extra - so the diagnostic will help in seeing how much the increments are and at what point they arise.
So we need to establish if the memory increase is as expected for the number of channels and lineup channels or if we are keeping in memory more than that.
Is there an impact ? any failures ? is the allocated extra memory freed later on ?
Memory
I’m based in the UK so it’s getting late here today, but if you send a test build I can test what you need me to over the weekend.
As far as I can tell the increased memory usage doesn’t have any negative impact to anything I use Plex for, though I wouldn’t call myself a heavy user (one Shield as main TV and a few Android/Apple devices).
However, you mention lineup matching being in memory - that might be something, I use XMLTV and the source file I generate for that using mc2xml is large - I asked about that in another post you had responded to regarding large XMLTV files:
It feels to me like this issue is likely related.
Is there a way to see if the guide refresh could cause a similar issue - is there a way to manually run the guide refresh task? I ask this because originally I thought the guide refresh increased the memory usage but was never sure when the refresh happened to be able to test around that suspicion, but then I found this large increase which is why I created this thread.
From what I have observed, memory is not freed up later on. I haven’t stopped/restarted Plex Server since this morning from the testing I did and currently Plex Dashboard is reporting around mid-40% still, as it was after the increase in the screenshot from earlier today, seen above, and Synology task manager is reporting 3.29GB for the Plex Server process.
We have issued fixes that stopped crashes with some xmltv files - seen with some with 20Mb size, 70Mb and 100Mb size. We are still crashing on some bigger files.
You could send me the xmltv file you are using when you send me logs from the special diagnostic build I sent you
Thanks for the diagnostic logs. I can see memory use increased when the DVR scheduler was running and also again when the XMLTV file was opened by PMS.
On windows the Plex Media Server crashes with this xmltv file. I already have an open issue on this with the development team for a 120Mb xmltv file that crashes PMS.
I will add your xmltv file to the open issue.
The xmltv file was opened to get the channels and that thread used up close to 2Gb of ram.
I will also ask for investigation into whether the memory gets released or kept to be re-used. There may be some kernel aspects here on releasing allocated memory
Curiously, starting at around 8pm last night DSM shows total memory usage was gradually reduced and it seems that’s all/mostly from Plex - the Plex Server is only using 1.32GB - less than it does at first startup!
All weekend when I’ve glanced at the stats in Plex (every 4-6hrs or so) it remained in the mid-40%'s.
This was all with the same diagnostic build you sent - I didn’t roll-back to a release version.
They would be of benefit if they cover the time when memory used by the process dropped from the 3.97 Gb level I saw in the earlier logs to much less than that