Plex DLNA Server Crashes

Server Version#: 1.30.0.6486

Hi,

I have been experiencing a problem with my PMS randomly not being available via DLNA.

All my devices in the house suddenly cannot connect to the PMS using DLNA.

If I restart PMS on the server then the devices can see it once again.

However, sometimes when playing a file the connection will disappear and the device playing the media errors and states that it’s lost connection and cannot continue playing the file. And sometimes, our devices just cannot find the PMS over DLNA either.

After some investigation and looking at the log files, the problem appears to be the Plex DLNA Server that is actually crashing and then does not restart. Restarting the whole PMS then resolves the problem for a while.

I updated to the latest version of PMS and have I have optimised the database which has stopped the crashes happening as frequent as they were. But I am still experiencing the crashes mostly once of twice a day. So I have enabled debug logging.

Here is an example of the error that is appearing in the Plex DLNA Server log file at the time that connection to the PMS is lost:

Jan 02, 2023 20:24:02.261 [2636] DEBUG - [HCl#5654] HTTP requesting GET http://127.0.0.1:32400/library/metadata/11339,11340,11341,11361,11362,11363,11364,11365,11366,11367,11368,11369,11370,11371,11372,11373,11374,11375,11376,11377,11378,11379
Jan 02, 2023 20:24:02.344 [5996] ERROR - [HttpClient] HttpClient: Exception thrown in HeaderReceived: bad allocation
Jan 02, 2023 20:24:02.344 [5996] WARN - [HttpClient/HCl#5654] HTTP error requesting GET http://127.0.0.1:32400/library/metadata/11339,11340,11341,11361,11362,11363,11364,11365,11366,11367,11368,11369,11370,11371,11372,11373,11374,11375,11376,11377,11378,11379 (23, Failed writing received data to disk/application) (Failure writing output to destination)
Jan 02, 2023 20:24:02.345 [4204] DEBUG - [HCl#5655] HTTP requesting GET http://127.0.0.1:32400/:/timeline?containerKey=%2Flibrary%2Fmetadata%2F16839&duration=5301472&guid=com.plexapp.agents.thetvdb%3A%2F%2F76846%2F23%2F1%3Flang%3Den&key=%2Flibrary%2Fmetadata%2F16839&ratingKey=16839&report=1&state=playing&time=4054000&X-Plex-Device=Generic&X-Plex-Device-Name=Generic&X-Plex-Product=DLNA
Jan 02, 2023 20:24:02.346 [5248] ERROR - XML: Memory allocation failed : growing buffer
Jan 02, 2023 20:24:02.346 [5248] ERROR - XML: Memory allocation failed : growing buffer
Jan 02, 2023 20:24:02.346 [5248] ERROR - Error parsing content.
Jan 02, 2023 20:24:02.346 [5248] ERROR - Unable to parse downloaded XML document: Error parsing file
Jan 02, 2023 20:24:02.346 [2636] ERROR - PlexContainer::GetStreamMetadata - unable to get directory /library/metadata/11339,11340,11341,11361,11362,11363,11364,11365,11366,11367,11368,11369,11370,11371,11372,11373,11374,11375,11376,11377,11378,11379

I can also see that a crashdump file is being created and being uploaded to Plex, but that seems to be failing with the following error:

Jan 01, 2023 17:41:13.023 [5456] ERROR - Failed to upload crashdump bfef4f7f-33c4-4e65-a60b-d0920ac232d8: 400
Jan 01, 2023 17:41:13.024 [5456] ERROR - Too many crashdumps detected / retries disallowed!
Jan 01, 2023 17:41:13.024 [5456] ERROR - Trashing C:\NNNNNNN\Plex Media Server\Crash Reports\1.30.0.6486-629d58034\PLEX DLNA SERVER\bfef4f7f-33c4-4e65-a60b-d0920ac232d8.dmp

I have attached the log files. Plex DLNA Server Logs.zip (3.5 MB)

Has anyone seen these errors before.

I have checked and there are no errors in Windows event log at this time. I have checked my hard disk and that all passes checks and I don’t seem to have any issues after testing the RAM. I have

Plex installed on my C drive and have about 35GB free and my library files are held on a 4TB drive that has about 30GB currently free. I can also see that my server is only using about 30% of it’s RAM when this issue occurs.

Thanks,

Chris

So my PMS was not available via DLNA tonight for my TV. I’ve checked at 19:25 and Plex DLNA Server appears to have crashed this morning at 10.33 with the following error messages:

Jan 04, 2023 10:33:07.792 [5860] ERROR - [HttpClient] HttpClient: Exception thrown in HeaderReceived: bad allocation
Jan 04, 2023 10:33:07.792 [5860] WARN - [HttpClient/HCl#5683] HTTP error requesting GET http://127.0.0.1:32400/library/metadata/9369/allLeaves (23, Failed writing received data to disk/application) (Failure writing output to destination)
Jan 04, 2023 10:33:07.793 [6420] ERROR - XML: Memory allocation failed : growing buffer
Jan 04, 2023 10:33:07.793 [6420] ERROR - XML: Memory allocation failed : growing buffer
Jan 04, 2023 10:33:07.793 [6420] ERROR - Error parsing content.
Jan 04, 2023 10:33:07.793 [6420] ERROR - Unable to parse downloaded XML document: Error parsing file
Jan 04, 2023 10:33:07.793 [5288] ERROR - DlnaDidlGenerator::generateForPlexPath - unable to get directory /library/metadata/9369/allLeaves

I can see from the log file that there are then these different errors up until 11:02 when the log file stops :

Jan 04, 2023 10:54:19.714 [5860] ERROR - [HttpClient] Thread: Couldn’t add a new thread to the pool of size 0: boost::thread_resource_error: Resource temporarily unavailable
Jan 04, 2023 10:55:20.794 [5860] ERROR - [HttpClient] Thread: Couldn’t add a new thread to the pool of size 0: boost::thread_resource_error: Resource temporarily unavailable
Jan 04, 2023 10:56:20.865 [5860] ERROR - [HttpClient] Thread: Couldn’t add a new thread to the pool of size 0: boost::thread_resource_error: Resource temporarily unavailable
Jan 04, 2023 10:57:21.933 [5860] ERROR - [HttpClient] Thread: Couldn’t add a new thread to the pool of size 0: boost::thread_resource_error: Resource temporarily unavailable
Jan 04, 2023 11:02:22.282 [5860] ERROR - [HttpClient] Thread: Couldn’t add a new thread to the pool of size 0: boost::thread_resource_error: Resource temporarily unavailable

I downloaded the logs at 19:25 before restarting the application. I have also found that there are files in the user account TEMP folder. These files are zero byte dump files and two log.zip files, one of which correlates to the date that I downloaded the log files so I presume that is the same file that Plex downloads with all the log files within it.

This time when I logged onto the server I could see that the Plex DLNA Server application was stuck at using 0% CPU and 1565.3 MB of RAM. This app is the highest usage of RAM on my machine.

MemoryUsageOnCrash

It looks like this problem is indeed memory related and I suspect the Plex DLNA Server application is hitting the 2GB RAM limit as I’ve also noticed that for some reason I have the 32 bit version of PMS installed on my 64 bit Windows Server OS. I have had this installed for a very long time and have not had any problems until very recently.

I am however concerned why the RAM usage is so high for this application.

Does anyone know if I can install the 64 bit version of PMS over the top of this 32 bit install? Or do I need to backup the databases etc and then uninstall and reinstall the 64 bit version.

Thanks,

Chris

I have now installed the 64 bit version over the top of the 32 bit installation on the evening of the 4th Jan. The DLNA application has not crashed since I did that.

However, I see there are still errors in the log and the memory usage of the app started at 40MB when I installed the 64 bit version and restarted the app and it’s now at 1400MB a couple of days later, without any media usage, and is slowly creeping up. I’m watching and the memory usage just keep slowly going up every few minutes.

PlexDLNACPUusage070123

How can I find out why this is happening?

Thanks,

Chris

These are the errors I am seeing in the Plex Media Server Log now:

Jan 05, 2023 06:34:54.010 [6708] ERROR - XML: Entity: line 1:
Jan 05, 2023 06:34:54.010 [6708] ERROR - XML: parser
Jan 05, 2023 06:34:54.010 [6708] ERROR - XML: error :
Jan 05, 2023 06:34:54.010 [6708] ERROR - XML: Start tag expected, ‘<’ not found
Jan 05, 2023 06:34:54.010 [6708] ERROR - XML: status=ok
Jan 05, 2023 06:34:54.010 [6708] ERROR - XML: ^
Jan 05, 2023 06:34:54.010 [6708] ERROR - Error parsing content.
Jan 05, 2023 06:34:54.010 [6708] ERROR - Error parsing XML: Error parsing file.

Thanks,

Chris

So I optimised the database again and cleaned the bundles and restarted the server. The DLNA application then sat at 43.3MB all evening. I checked it this morning and it was at 1053.7MB. I checked the log files and could not find any XML parser errors or memory allocation errors anymore.

I restarted the server this afternoon and the memory usage reset and started at 38.8MB. It is now at 39.7MB so I will monitor to see if the memory usage increases significantly overnight again. I guess, if it does, then this is being caused by an overnight scheduled task. If it does increase significantly I will see what happens over several nights and see if the memory usage keeps increasing and see if this is the pattern.

Thanks,

Chris

There is/was a bug in the Plex DLNA server. I do not know if it was ever fixed.

If the Plex DLNA server is enabled and there is an LG TV on the network, Plex Media Server will slowly consume all available RAM.

The only workarounds are:

  • Disable the Plex DLNA server
  • Disconnect the LG TV from the network.

Plex clients do not use DLNA to communicate with the Plex Media Server. Disabling the Plex DLNA server will have no effect on Plex clients.

If you have some devices that need DLNA, note that Windows includes its own DLNA server. You might try using it instead of the one included with Plex.

These are noise and can be ignored. Plex sends out SSDP discovery packets looking for clients, other servers, etc. Some devices reply in a format Plex does not understand. When that happens, Plex logs an error and continues.

Thanks so much FordGuy61 for that answer.

I have checked this morning and can see that the memory usage is now at 1064.2MB this morning.

I think it’s time for me to look for another media server solution, which is a shame as I’ve been a huge fan of Plex for many years but I need to use DLNA and cannot afford to replace my LG TV. I will investigate Windows DLNA services and see if that will provide the functionality I require.

Thanks,

Chris

FYI, you don’t have to replace Plex entirely, just use a different DLNA server.

I do not use DLNA on my network. Not sure if Plex competitors include DLNA in their offerings.

Thanks. I only really use Plex as a DLNA media server and I don’t use any of it’s other features so I’ve now installed JellyFin to test it’s capabilities.

I’m running Windows Server and configuring that as a DLNA server is a bit of a pain, by the looks of it.

Whilst testing some other DLNA media servers I have noticed a pattern that appears to start the increasing memory usage with the Plex DLNA Server. If I restart Plex the memory usage of the Plex DLNA Server sits at around 40 MB for hours and hours even whilst watching media on the LG TV using DLNA. However, shortly after I switch off the LG TV the memory usage starts to increase steadily every minute or two. I have been restarting Plex every day or two to release the memory usage. This is why I have been seeing a huge usage of memory overnight and not during the day as I have the TV on most days. It appears as if the Plex DLNA Server is trying to continually communicate with the LG TV even though it is switched off. I have removed the TV from the network completely and the memory usage continues to grow whilst it is switched off. When I switch the TV back on I can see that the memory usage slows down but still increases. To clear the memory usage I just have to restart Plex either with or without the TV on.

Out of interest I checked the memory usage this morning and it normal so I checked the log files and could see that the Plex DLNA Server service appears to have restarted overnight, which has never happened. Is there a scheduled job that does this restart?

Jan 22, 2023 00:30:40.740 [3264] DEBUG - Jobs: ‘C:\Program Files\Plex\Plex Media Server\Plex Dlna Server.exe’ exit code for process 4252 is -1073741819 ()
Jan 22, 2023 00:30:40.765 [5972] DEBUG - [ChildProcessMonitor] Plex Dlna Server.exe exited.
Jan 22, 2023 00:30:40.765 [5972] DEBUG - [ChildProcessMonitor] attempting to relaunch Plex Dlna Server.exe; attempt number 1, 2 tries remaining

Just for fun, I have also installed and tested Plex on another machine (Windows 10) on my network and it does not have this memory usage problem and I have added libraries and watched media on the LG TV. I have left this Windows 10 machine on overnight and the memory usage remains at about 40 MB. So it looks like there might be a problem with the install specifically on my Windows Server.

Thanks.

1 Like

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