I am afraid so - but I am keen to see if there are other leaks as well. Unfortunately, it is difficult whilst this leak is in
Update: We are patching FreeImage
No need for more logs until the patched package is released in a Plex Media Server release. Don’t know at this point which version of Plex Media Server this will be in. Further logs will only be needed if there is still a memory issue after that
The fix for the FreeImage related memory leak has been released in today’s beta
In the event of there remaining further memory leaks, please enable the new logging preference for memory use and provide logs
I’m afraid the leak is still there. I managed to double my RAM from 100 to 200MB in a few minutes by just clicking around my TV shows. Can supply logs if needed.
Would need logs to see that the memory remains when the server gets to an idle state - so please logs covering time from launch up to time when it is idle and memory has increased significantly
I will supply you the logs via PM shortly, I first doubled the RAM and then had it sit idle for 2 hours to ensure it could have been released.
was doing some housekeeping which made me sift through my 1760 movies and open a number of them for metadata renaming.
Started from 250mb or so after updating my Docker image to now over 1 GB in about 30 minutes lol
looking forward for the beta to be on stable to see if it helps me… this just recently started happening for me though
Yup, I’m seeing the same still on 1.20.4 as well. Already supplied some fresh logs so hopefully they can figure out what’s causing this if it’s not FreeImage.
I will need fresh logs covering longer period to confirm that memory is still creeping up and reaching 2Gb or more. The initial logs just covered first few hours and only got to about 300Mb - which is not seen as an issue
Personally an idle Plex Media Server at 1GB RAM should never be ok. If it’s not using that memory on a server that is under memory pressure it should be able to release that memory back to the kernel. Just by clicking around for 10 minutes in my interface just now and looking at movie posters I went from 600MB (which was already high imho) to the now 1GB. I’m pretty sure if I keep clicking around I can get to 2GB if that’s a hard requirement to look into this further. Please let me know and I will gladly spend the time.
I did pass on your logs with memory at 300Mb but that was not good enough to start a new investigation. The memory leak within FreeImage has been fixed and we need to see if there is still an issue that would break Plex Media Server. So if a docker image process reaches a cap of 2Gb or 4Gb and crashes out after a number of days then the logs for that would allow me to open a new issue with the development team to start an investigation.
I would need logs from launch time and with the memory usage logging - so may need capturing logs every day or two (depending on how quickly they cycle round) - another option is to try a large LogNumFiles setting value and see if that would cover period from launch until a crash at 2Gb or 4Gb
There is a bit of an issue here. In order to do what you ask I need to disable my automatic restart scripts. But if I do that the various Plex servers end up using 256GB of RAM in a matter of days. So no way server will have the chance to hit the 4GB requirement.
I will see if I can can setup a staging server that replicates everything so I have a better control group for the testing.
@sa2000, this guy is doing the stuff Plex Team ought to be doing.
… jus’ sayin’ …
I’ve done some scripted tested to further pin down where the memory is coming from but so far I am still unable to find it.
What I can rule out is the photo transcoder in versions 1.20.5 at least. I’ve done 20.000 scripted requests directly to the transcoder (/photo/:/transcode) bypassing the website forcing various different sizes to exclude caching kicking in and although during the process it would go up in memory usage it would always free the memory up once all the photo transcoding was done.
However when I simply click around the app.plex.tv interface as a user the memory does keep increasing. It also seems to happen around the time the photo transcoder kicks in, but not on every request.
Here is a 20MB RAM jump where nothing else but the photo transcoder appears to happen.
Nov 17, 2020 13:49:38.932 [0x7fd4d7fff700] DEBUG - Request: [62.251.114.227:50740 (WAN)] GET /photo/:/transcode?width=240&height=360&minSize=1&upscale=1&url=%2Flibrary%2Fmetadata%2F48%2Fthumb%2F1605548853%3FX-Plex-Token%3Dxxxxxxxxxxxxxxxxxxxx (12 live) TLS GZIP Signed-in Token (Animazing) (Memory Usage: 541.0 MB/3691.0 MB)
Nov 17, 2020 13:49:38.932 [0x7fd4d7fff700] DEBUG - [Transcode] Photo transcoder: Request for url [/library/metadata/48/thumb/1605548853?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx] (is local: 1 upscaled: 1)
Nov 17, 2020 13:49:38.933 [0x7fd4d7fff700] DEBUG - [Transcode] Auth: authenticated user 1 as Animazing
Nov 17, 2020 13:49:38.934 [0x7fd4d7fff700] DEBUG - [Transcode] Computed media url for item 48: http://127.0.0.1:42915/system/agents/media/get?guid=com%2Eplexapp%2Eagents%2Ethetvdb%3A%2F%2F79488%2F1%3Flang%3Den&mediaType=3&url=metadata%3A%2F%2Fseasons%2F1%2Fposters%2Fcom%2Eplexapp%2Eagents%2Ethetvdb_eee59cd666647b6916d64d84b20b9889b981c1d8
Nov 17, 2020 13:49:38.935 [0x7fd4d7fff700] DEBUG - [Transcode] HTTP requesting GET http://127.0.0.1:42915/system/agents/media/get?guid=com%2Eplexapp%2Eagents%2Ethetvdb%3A%2F%2F79488%2F1%3Flang%3Den&mediaType=3&url=metadata%3A%2F%2Fseasons%2F1%2Fposters%2Fcom%2Eplexapp%2Eagents%2Ethetvdb_eee59cd666647b6916d64d84b20b9889b981c1d8
Nov 17, 2020 13:49:38.942 [0x7fd4d7fff700] DEBUG - [Transcode] HTTP 200 response from GET http://127.0.0.1:42915/system/agents/media/get?guid=com%2Eplexapp%2Eagents%2Ethetvdb%3A%2F%2F79488%2F1%3Flang%3Den&mediaType=3&url=metadata%3A%2F%2Fseasons%2F1%2Fposters%2Fcom%2Eplexapp%2Eagents%2Ethetvdb_eee59cd666647b6916d64d84b20b9889b981c1d8
Nov 17, 2020 13:49:38.943 [0x7fd4d7fff700] DEBUG - [Transcode] Calculated media file path for path [metadata://seasons/1/posters/com.plexapp.agents.thetvdb_eee59cd666647b6916d64d84b20b9889b981c1d8]: ["/config/Library/Application Support/Plex Media Server/Metadata/TV Shows/3/574c527354f1a2c4b5801933824470a352b8604.bundle/Contents/_combined/seasons/1/posters/com.plexapp.agents.thetvdb_eee59cd666647b6916d64d84b20b9889b981c1d8"]
Nov 17, 2020 13:49:38.943 [0x7fd4d7fff700] DEBUG - [Transcode] Calling back into ourselves for photo to transcode, optimizing the process (status: -1)
Nov 17, 2020 13:49:38.943 [0x7fd4d7fff700] DEBUG - [Transcode] Photo cache obtained 48000 bytes from /library/metadata/48/thumb/1605548853?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx
Nov 17, 2020 13:49:38.943 [0x7fd4d7fff700] DEBUG - [Transcode] Saving original media file to /config/Library/Application Support/Plex Media Server/Cache/PhotoTranscoder/ca/ca0993392ccf8bca1474f9d0b31d22dfb6da2258.jpg
Nov 17, 2020 13:49:38.950 [0x7fd4f7fff700] DEBUG - Request: [62.251.114.227:50741 (WAN)] GET /library/metadata/25/related?includeAugmentations=1&includeExternalMetadata=1&includeMeta=1 (12 live) TLS GZIP Signed-in Token (Animazing) (Memory Usage: 560.0 MB/3710.0 MB)
Nov 17, 2020 13:49:38.952 [0x7fd4d7fff700] DEBUG - [Transcode] Created thumbnail of size 249x360, has pixels: 1
And an other a few minutes later.
Nov 17, 2020 13:52:36.997 [0x7fd5622ee700] DEBUG - Completed: [62.251.114.227:51562] 200 GET /photo/:/transcode?width=240&height=360&minSize=1&upscale=1&url=%2Flibrary%2Fmetadata%2F322%2Fthumb%2F1605548983%3FX-Plex-Token%3Dxxxxxxxxxxxxxxxxxxxx (9 live) TLS GZIP 0ms 21663 bytes (pipelined: 1) (Memory Usage: 560.0 MB/3711.0 MB)
Nov 17, 2020 13:52:37.009 [0x7fd4d67fc700] DEBUG - [Transcode] HTTP 200 response from GET http://127.0.0.1:42915/system/agents/media/get?guid=com%2Eplexapp%2Eagents%2Eimdb%3A%2F%2Ftt0091203%3Flang%3Den&mediaType=1&url=metadata%3A%2F%2Fposters%2Fcom%2Eplexapp%2Eagents%2Eimdb_c4e4e56b9d1650f6ef6e1d4edb1c9cc5b155ae9f
Nov 17, 2020 13:52:37.009 [0x7fd4d67fc700] DEBUG - [Transcode] Calculated media file path for path [metadata://posters/com.plexapp.agents.imdb_c4e4e56b9d1650f6ef6e1d4edb1c9cc5b155ae9f]: ["/config/Library/Application Support/Plex Media Server/Metadata/Movies/3/b2b565e63db0dd1f3523468cda09e9f001b96db.bundle/Contents/_combined/posters/com.plexapp.agents.imdb_c4e4e56b9d1650f6ef6e1d4edb1c9cc5b155ae9f"]
Nov 17, 2020 13:52:37.009 [0x7fd4d67fc700] DEBUG - [Transcode] Calling back into ourselves for photo to transcode, optimizing the process (status: -1)
Nov 17, 2020 13:52:37.010 [0x7fd4d67fc700] DEBUG - [Transcode] Photo cache obtained 1754704 bytes from /library/metadata/15/thumb/1605548837?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx
Nov 17, 2020 13:52:37.010 [0x7fd4d67fc700] DEBUG - [Transcode] Saving original media file to /config/Library/Application Support/Plex Media Server/Cache/PhotoTranscoder/5e/5e65a59cd3f2bd90f74d5637967b1a861045d665.jpg
Nov 17, 2020 13:52:37.193 [0x7fd4d67fc700] DEBUG - [Transcode] Created thumbnail of size 240x373, has pixels: 1
Nov 17, 2020 13:52:37.201 [0x7fd561aed700] DEBUG - Completed: [62.251.114.227:51561] 200 GET /photo/:/transcode?width=240&height=360&minSize=1&upscale=1&url=%2Flibrary%2Fmetadata%2F15%2Fthumb%2F1605548837%3FX-Plex-Token%3Dxxxxxxxxxxxxxxxxxxxx (9 live) TLS GZIP 215ms 22778 bytes (pipelined: 1) (Memory Usage: 578.0 MB/3729.0 MB)
Just to again clarify I did nothing on this instance except browsing the interface, no streaming, no adding of content, just browsing.
So it looks like it’s still coming from the transcoder however when calling the transcoder as a script and not a user navigating Plex.tv the leaks don’t happen. Anything a dev can think of that might cause this behaviour?
could you elaborate on what you call “browsing” ?
I’d like to try & replicate, but I’m not getting any noteworthy leak by browsing .
First off make sure you disable local browser image caching. In chrome you can do that by keeping the web inspector open, going to the network tab and then pressing “Disable cache” as long as the inspector is open I think it shouldn’t cache images.
Then also wipe your cache folder so Plex will create new thumbnails, you can do this by removing the /Library/Application Support/Plex Media Server/Cache/PhotoTranscoder folder.
Now what I do is just clicking around my various libraries and looking at item pages. This morning I could even replicate it just clicking from a Movies library to an TV library without actually clicking any items inside the libraries but your milage might vary.
Let me know if you can replicate the behaviour 
what are you using to track the PMS process mem usage ?
Proxmox usage graph is too crude. top & related doesn’t seem very handy …
The devs added LogMemoryUse to the Preferences.xml file after which most log statements will include the memory usage. See https://support.plex.tv/articles/201105343-advanced-hidden-server-settings/
My Plex and FreeNas are also crashing overnight with an out of swap message on the freenas console. I did turn on LogMemoryUse in Plex and now have the following files in my log directory. Are any of them useful and whom should I send them to?
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Scanner Deep Analysis.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Scanner Deep Analysis.1.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Scanner Deep Analysis.2.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Scanner Deep Analysis.3.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Scanner Deep Analysis.4.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Scanner Deep Analysis.5.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Scanner Analysis.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Scanner Analysis.1.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Scanner Analysis.2.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Scanner Analysis.3.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Scanner Analysis.4.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Scanner Analysis.5.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Server.4.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Scanner.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Server.5.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Scanner.1.log”
“\root\usr\local\plexdata-plexpass\Plex Media Server\Logs\Plex Media Scanner.2.log”


