gboudreau / XBMCnfoTVImporter.bundle

360 stars 69 forks source link

Memory Leak on Mac OS X /w Plex v1.1.3.2700 #82

Closed dwhagar closed 7 years ago

dwhagar commented 8 years ago

For some reason when the Plex executes the plugin to update metadata from changed .nfo files, the system slogs to a halt. The plugin quickly gobbles up RAM until the system no longer has enough RAM. The process remains in this state until killed.

I tried this several times, each time killing the process returned the system to normal within seconds.

Em31Et commented 8 years ago

It may be a bug for multiple episode file (e.g. S01E01E02.mkv). For multiple episode file, it add "S01E01E02.mkv" as possible thumb file and then load into memory, so all memory gone and hang.

if (nfoepc > 1) and (not Prefs['multEpisodePlexPatch'] or not multEpTestPlexPatch):
                                            for name in glob.glob1(os.path.dirname(nfoFile), '*S' + str(season_num.zfill(2)) + 'E' + str(ep_num.zfill(2)) + '*.*'):
                                                if "-E" in name: continue
                                                episodeThumbNames.append (**os.path.join(os.path.dirname(nfoFile), name)**)

I am not familiar with python, just comment the following code to fix it temporary.

#episodeThumbNames.append (**os.path.join(os.path.dirname(nfoFile), name)**)
dwhagar commented 8 years ago

I’m not familiar with Python 2.x, what might we do to fix this? I don’t mind making a commit or testing a possible patch myself.

David Wade Hagar david.hagar@gmail.com http://home.blazingumbra.com/cyclops.html

The freedom of expression protects you from governmental prosecution for something you've said. It does not, nor has it ever, protected you from potentially harmful reactions of friends, neighbors, or employers, because you've said something stupid. Doing so would infringe on their freedom of expression.

On Oct 11, 2016, at 10:11 AM, Em31Et notifications@github.com wrote:

It is a bug for multiple episode file (e.g. S01E01E02.mkv).

if (nfoepc > 1) and (not Prefs['multEpisodePlexPatch'] or not multEpTestPlexPatch): for name in glob.glob1(os.path.dirname(nfoFile), '_S' + str(season_num.zfill(2)) + 'E' + str(epnum.zfill(2)) + '._'): if "-E" in name: continue episodeThumbNames.append (_os.path.join(os.path.dirname(nfoFile), name)*) For multiple episode file, it add "S01E01E02.mkv" as possible thumb file and then load into memory, so all memory gone and hang.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gboudreau/XBMCnfoTVImporter.bundle/issues/82#issuecomment-252928088, or mute the thread https://github.com/notifications/unsubscribe-auth/AF5kmjWfoeFbGj09pymm0aeU8TG7J-_iks5qy5kEgaJpZM4J4uCr.

Em31Et commented 8 years ago

seems the code is used for the following case S01E01E02.mkv S01E02.jpg <- to search the separated thumb file for 2nd episode

Change the following line to load "jpg" file only may help.

From

for name in glob.glob1(os.path.dirname(nfoFile), '*S' + str(season_num.zfill(2)) + 'E' + str(ep_num.zfill(2)) + '*.*'):

To

 # *.* => *.jpg
for name in glob.glob1(os.path.dirname(nfoFile), '*S' + str(season_num.zfill(2)) + 'E' + str(ep_num.zfill(2)) + '*.jpg'):
dwhagar commented 8 years ago

Sweet, I’ll give that a try.

David Wade Hagar david.hagar@gmail.com http://home.blazingumbra.com/cyclops.html

The freedom of expression protects you from governmental prosecution for something you've said. It does not, nor has it ever, protected you from potentially harmful reactions of friends, neighbors, or employers, because you've said something stupid. Doing so would infringe on their freedom of expression.

On Oct 11, 2016, at 10:53 AM, Em31Et notifications@github.com wrote:

seems the code is used for the following case S01E01E02.mkv S01E02.jpg <- to search the separated thumb file for 2nd episode

Change the following line to load "jpg" file only.

From

for name in glob.glob1(os.path.dirname(nfoFile), '_S' + str(season_num.zfill(2)) + 'E' + str(epnum.zfill(2)) + '.*'): To

. => _.jpg

for name in glob.glob1(os.path.dirname(nfoFile), '_S' + str(season_num.zfill(2)) + 'E' + str(ep_num.zfill(2)) + '*.jpg'): — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gboudreau/XBMCnfoTVImporter.bundle/issues/82#issuecomment-252941195, or mute the thread https://github.com/notifications/unsubscribe-auth/AF5kmhHX-M6rMOQiQovMQiFaz-hcqOKaks5qy6LtgaJpZM4J4uCr.

SlrG commented 8 years ago

Cool. Thanks for reporting and supplying a fix. :) I'll add this to the agents and release a fixed version soon.

SlrG commented 8 years ago

@dwhagar : I added @Em31Et s fix to the tv agent. Please give it a try and report if it fixes your problems.

SlrG commented 8 years ago

@dwhagar: Please report back, and close the issue if solved. Thanks. :)

SlrG commented 7 years ago

Seems to be resolved.