Question regarding memory usage (increasing)

Currently Running Linux version 1.16.2.1321 (upgrading tomorrow when I get some quiet time to 1.16.3.1402

For quite a while now I have been running a nightly cron to restart due to all the plex “features” and thought I would try not doing that since the memory leaks seem to be reported as being fixed now!

The uptime is 4.5 days (which is more than it did before with memory issues) but the plex process is still slowly rising and is now at :

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1675 plex 20 0 8904296 6.090g 15824 S 20.9 25.9 1569:43 Plex Media+

What is the normal memory usage for plex process? > 6GB Res seems high and is slowly rising…

No comments yet :slight_smile:
Upgraded to 1.16.3.1402 this morning.

Memory at that point was under 1GB Res.
It as been slowly climbing during the day. at approx 12 hours in it stands at 2.9GB…
Will check in and update in the morning.

26/7 21:30
22816 plex 20 0 6535416 2.912g 27756 S 29.6 12.4 207:28.61 Plex Media+

27/7 09:30
22816 plex 20 0 6740188 3.328g 25296 S 3.7 14.1 360:08.13 Plex Media+

28/7 17:30
22816 plex 20 0 7509484 4.474g 22132 S 3.7 19.0 909:10.49 Plex Media Serv

29/7 08:30
22816 plex 20 0 8197596 5.181g 20920 S 7.6 22.0 1117:17 Plex Media Serv

30/7 08:00
22816 plex 20 0 8508884 5.681g 17832 S 34.7 24.1 1464:27 Plex Media Serv

30/7 21:00
22816 plex 20 0 9180700 6.349g 17900 S 7.3 27.0 1752:01 Plex Media Serv

Which options are you looking at ? Are you looking at total VSZ (Virtual size) or WSS (working set size). Virtual Size will grow as PMS needs to expand the WSS during processing. Once processing is complete, it releases that memory back to the system and WSS decreases.

What you show above looks like 2.9GB VSZ with a working set size of 27756 pages (4K each) for a total of 111 MB of active RAM.

By comparison, on QNAP, with my server active. I use a bit more (297 MB)

@ChuckPa

The output is from standard “top” so it is the RES setting that I am looking at. - the real memory used.

Up from 2.9Gb last night to 3.3Gb this morning. I suspect like the last version it will just rise and rise until something bad happens!

To be clear of columns as the headers are not posted from the 9.30 one today

Virt = 6740188
Res = 3.328g
SHR = 25296

Latest edit added to above post… still rising

@ChuckPa

Sorry to tag again!

Updated post 2 with more point captures. RES memory is now over 6GB and still climbing.
Is there anything that can be looked at?

Thanks.

No worries! Is DLNA enabled ?

No, DLNA is not used (and unticked in settings)

This is Debian/Ubuntu ?

If so, and you’re up to a bit of an experiment,

Here’s a version which is a bit older. Let’s see if the leak is recent or not

It will also let you see the new installer if you’re interested.

Make certain to get the newer (listed further down) of the AMD64 builds.

The server is running Ubuntu 18.04.2 LTS
(Running as a VM under ESXi 6.7)

I assume you mean the July the 7th links from the post for the 1.16.2.1311 build?
Yes happy to give that a go. I will find a quiet point in the morning and install it and report back.

One point of note before I go for that version.

As well as happening on the version now : 1.16.3.1402 it was definately happening on 1.16.2.1321 prior to this.

Thanks.

You’re very welcome and yes, build 1311. It slightly predates 1321 and works very well for me here.

please let me know your views on how the new installation process works / reports.

Downgrade complete. All seemed to work fine :

dpkg: warning: downgrading plexmediaserver from 1.16.3.1402-22929c8a2 to 1.16.2.1311-4b7ace214
(Reading database … 332150 files and directories currently installed.)
Preparing to unpack plexmediaserver_1.16.2.1311-4b7ace214_amd64.deb?_ga=2.10335676.807933167.1564332882-815913328.1563545794 …
Removed /etc/systemd/system/multi-user.target.wants/plexmediaserver.service.
PlexMediaServer installer: Pre-installation Validation.
PlexMediaServer installer: Pre-installation Validation complete.
Unpacking plexmediaserver (1.16.2.1311-4b7ace214) over (1.16.3.1402-22929c8a2) …
dpkg: warning: unable to delete old directory ‘/etc/init’: Directory not empty
Setting up plexmediaserver (1.16.2.1311-4b7ace214) …
PlexMediaServer installer:
PlexMediaServer installer: Now installing based on:
PlexMediaServer installer: Process Control: Systemd
PlexMediaServer installer: Plex User: plex
PlexMediaServer installer: Plex Group: plex
PlexMediaServer installer: Video Group: video
PlexMediaServer installer: Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer installer: Temp Directory: /var/lib/plexmediaserver/tmp_transcoding
PlexMediaServer installer: Lang Encoding: en_US.UTF-8
PlexMediaServer installer: HW transcoding: Found
PlexMediaServer installer:
PlexMediaServer installer: Completing final configuration.
Created symlink /etc/systemd/system/multi-user.target.wants/plexmediaserver.service → /lib/systemd/system/plexmediaserver.service.
PlexMediaServer installer: PlexMediaServer-1.16.2.1311-4b7ace214 - Installation successful.
Processing triggers for libc-bin (2.27-3ubuntu1) …
Processing triggers for mime-support (3.60ubuntu1) …
Processing triggers for ureadahead (0.100.0-21) …

Initial Plexmediaserver “RES” Memory 0.46GB

7714 plex 20 0 4838204 460464 38636 S 72.1 1.9 1:48.53 Plex Media Serv

Willl report back later when it has had some time to run…

@ChuckPa

12 hour update 31/7 19:00
7714 plex 20 0 6518596 2.686g 25412 S 21.3 11.4 128:07.02 Plex Media Serv

RES Memory usage up to 2.6GB…

I am running a VM now since our discussion yesterday.

I also have a couple of test servers (one a VM - On hyper-v, rather than ESXi and another on bare metal) and they also increase but at a MUCH slower rate.

The obvious thing that jumps out is the one that increases at a good pace gets a lot of use.

I have also discussed with some others and it seems the more use the faster the increase.

PS now up to 2.8GB :slight_smile:
7714 plex 20 0 6723400 2.887g 25200 S 18.3 12.3 147:57.33 Plex Media Serv

Has your server that is sat there had any plays? Has it scanned any media? I guess there are many things that can cause it!

I let the server sit. Nothing happened.
I then had it add media. Minor growth but that is expected given the agents are activated.

Next steps:

  1. Play media (loads profiles, activates playback portion of the server)
  2. Direct Stream (Remux)
  3. Full transcode.

Thanks for looking. I guess the plays on my main server are pretty much a 50/50 mix of direct stream and transcodes of various quality settings.

Server is using quicksync - passthrough for the video transcodes.

Just for reference :

1 ) Server down-graded this morning - this one gets a lot of use. (VM under ESXi with quicksync passthrough) Plex uptime circa 13.5 hours
7714 plex 20 0 6723400 2.923g 22096 S 15.0 12.4 156:51.39 Plex Media Ser

2 ) VM under hyper-v Plex uptime a couple of weeks - only 1 play in last 2 weeks and some media scanning
1177 plex 20 0 2810828 754500 37224 S 0.0 18.8 1:33.27 Plex Media Serv

3 ) Bare metal Server (test) - Plex uptime > 2 weeks - virtually 0 plays - fair bit of media scanning
1027 plex 20 0 8831588 4.191g 3964 S 0.0 26.9 88:55.47 Plex Media Serv

2/8 17:00
7714 plex 20 0 7680664 3.887g 21876 S 2.3 16.5 798:55.08 Plex Media Serv

Uptime almost 1.5 days Res now > 3.8GB

This is my QNAP. It shows a nice cleanly traceable memory utilization. Notice VSZ and RSS are different. We have to be careful not to confuse the two. Resident is what will use memory.

  PID   VSZ VSZRW   RSS (SHR) DIRTY (SHR) STACK COMMAND
 6595 5091m  867m 65768 59632 63716 57580   132 /share/CACHEDEV1_DATA/.qpkg/QKVM/usr/bin/uwsgi --ini /share/CACHEDEV1_DATA/.qpkg/QKVM/usr/etc/uwsgi.ini
 6578 5091m  867m 65756 59628 63704 57576   132 /share/CACHEDEV1_DATA/.qpkg/QKVM/usr/bin/uwsgi --ini /share/CACHEDEV1_DATA/.qpkg/QKVM/usr/etc/uwsgi.ini
 6580 5091m  867m 65748 59632 63696 57580   132 /share/CACHEDEV1_DATA/.qpkg/QKVM/usr/bin/uwsgi --ini /share/CACHEDEV1_DATA/.qpkg/QKVM/usr/etc/uwsgi.ini
 6579 5091m  867m 65744 59632 63692 57580   132 /share/CACHEDEV1_DATA/.qpkg/QKVM/usr/bin/uwsgi --ini /share/CACHEDEV1_DATA/.qpkg/QKVM/usr/etc/uwsgi.ini
15047 4438m  468m  122m 16220 98852  2976   128 ./Plex Media Server
[~] # uptime
 15:58:23 up 1 day,  4:16,  load average: 1.84, 1.99, 1.85
[~] # 

So you are not seeing an increase, I can replicate on several machines and I know others can! (getting others to pile in with “me 2” comments will not help I assume?)

Will any logs help?

in the last 5 hours main server has gone from 3.8GB res to 4.7GB !

7714 plex 20 0 8254160 4.773g 19688 S 50.8 20.3 899:06.07 Plex Media Serv

I can allways go back to my daily cron jobs to restart the process but just trying to help in fixing what looks to be a clear bug!

This post also seems to be a similar issue?

I would recommend that anyone who is running into this issue do the two things I did in my post that is tracking the issue:

  1. run a script that tracks memory utlization of the PMS service and upload the output
  2. increase the amount of PMS logs kept to 20 and upload the PMS troubleshooting package to the forum.

Simply responding “me too” does not provide any value. Providing memory utilization statistics and PMS log packages does provide value.