Lacro59 / playnite-successstory-plugin

This plugin shows the game achievements in Playnite.
https://playnite.link
MIT License
162 stars 29 forks source link

memory leak with RetroAchievement #89

Closed Lacro59 closed 3 years ago

Lacro59 commented 3 years ago

from sofmarch on forum (https://playnite.link/forum/thread-275-post-2947.html#pid2947)

Having a bizarre issue that I narrowed down to this plugin. With this plugin running whenever I select a PSP game the amount of memory being used by Playnite skyrockets exponentially.

Before Selecting Playnite is 171.6 MB image

After Selecting Playnite is at 1435 MB image

Here's the playnite log


19-12 17:40:53.532|INFO|PlayniteApplication:Application started from 'C:\Users\Tedd\AppData\Local\Playnite'
19-12 17:40:53.792|INFO|ExtensionFactory:Loaded plugin: Simple Game Import, version 1.0
19-12 17:40:54.002|INFO|CheckVersion:PluginCommon - DescriptionEditor - Find v1.3.1 - Actual v1.3.1
19-12 17:40:54.002|INFO|ExtensionFactory:Loaded plugin: DescriptionEditor, version 1.3.1
19-12 17:40:54.178|INFO|CheckVersion:PluginCommon - GameActivity - Find v1.2.1 - Actual v1.2.1
19-12 17:40:54.178|INFO|ExtensionFactory:Loaded plugin: GameActivity, version 1.2.1
19-12 17:40:54.354|INFO|CheckVersion:PluginCommon - HowLongToBeat - Find v1.2.1 - Actual v1.2.1
19-12 17:40:54.365|INFO|ExtensionFactory:Loaded plugin: HowLongToBeat, version 1.2.1
19-12 17:40:54.505|INFO|CheckVersion:PluginCommon - IsThereAnyDeal - Find v1.2.1 - Actual v1.2.1
19-12 17:40:54.505|INFO|ExtensionFactory:Loaded plugin: IsThereAnyDeal, version 1.2.1
19-12 17:40:54.645|INFO|CheckVersion:PluginCommon - MetadataLocal - Find v1.2.1 - Actual v1.2.1
19-12 17:40:54.645|INFO|ExtensionFactory:Loaded plugin: Metadata Local, version 1.2.1
19-12 17:40:54.855|INFO|CheckVersion:PluginCommon - SuccessStory - Find v1.2.1 - Actual v1.2.1
19-12 17:40:54.855|INFO|ExtensionFactory:Loaded plugin: SuccessStory, version 1.2.1
19-12 17:40:54.995|INFO|CheckVersion:PluginCommon - ThemeModifier - Find v1.2.1 - Actual v1.2.1
19-12 17:40:55.104|INFO|ExtensionFactory:Loaded plugin: ThemeModifier, version 1.2.1
19-12 17:40:55.663|INFO|ExtensionFactory:Loaded plugin: LBGDB metadata provider, version 2.0.0
19-12 17:40:55.663|INFO|ExtensionFactory:Loaded plugin: RAWG metadata provider, version 2.0.0
19-12 17:40:55.663|INFO|SGDBMetadataSettings:saved settings
19-12 17:40:55.674|INFO|SGDBMetadataSettings:a8989aebe28f0012573963ea66e7bc09
19-12 17:40:55.674|INFO|SGDBMetadataSettings:
19-12 17:40:55.674|INFO|SGDBMetadataSettings:
19-12 17:40:55.674|INFO|ExtensionFactory:Loaded plugin: SteamGridDB Metadata Provider, version 0.5.6
19-12 17:40:55.674|INFO|ExtensionFactory:Loaded plugin: Universal Steam Metadata, version 1.4
19-12 17:40:55.725|INFO|ExtensionFactory:Loaded plugin: Epic Store Library Importer, version 1.0
19-12 17:40:55.725|INFO|ExtensionFactory:Loaded plugin: GOG Library Importer, version 1.0
19-12 17:40:55.725|INFO|ExtensionFactory:Loaded plugin: IGDB metadata provider, version 1.0
19-12 17:40:55.779|INFO|ExtensionFactory:Loaded plugin: itch.io Library Importer, version 1.0
19-12 17:40:55.785|INFO|ExtensionFactory:Loaded plugin: Origin Library Importer, version 1.0
19-12 17:40:55.785|INFO|ExtensionFactory:Loaded plugin: PlayStation Library Importer, version 1.0
19-12 17:40:55.802|INFO|ExtensionFactory:Loaded plugin: Steam Library Importer, version 1.0
19-12 17:40:55.843|INFO|ExtensionFactory:Loaded plugin: Uplay Library Importer, version 1.0
19-12 17:40:55.848|INFO|ExtensionFactory:Loaded plugin: Xbox Library Importer, version 1.0
19-12 17:40:56.020|INFO|ExtensionFactory:Loaded script extension: C:\Users\Tedd\AppData\Roaming\Playnite\Extensions\Game_Media_Tools\GameMediaTools.ps1, version 1.3
19-12 17:40:56.091|INFO|ExtensionFactory:Loaded script extension: C:\Users\Tedd\AppData\Roaming\Playnite\Extensions\Links_Sorter\LinksSorter.ps1, version 1.0.1
19-12 17:40:56.131|INFO|ExtensionFactory:Loaded script extension: C:\Users\Tedd\AppData\Roaming\Playnite\Extensions\Steam_DB_Rating\SteamDbRating.ps1, version 1.0.1
19-12 17:40:56.192|INFO|ExtensionFactory:Loaded script extension: C:\Users\Tedd\AppData\Local\Playnite\Extensions\LibraryExporter\LibraryExporter.ps1, version 1.0
19-12 17:40:56.287|DEBUG|WindowFactory:Show window Playnite.DesktopApp.Windows.MainWindowFactory
19-12 17:40:56.287|DEBUG|WindowFactory:Opening window that was closed previously Playnite.DesktopApp.Windows.MainWindowFactory
19-12 17:40:56.486|DEBUG|WindowFactory:Show dialog window Playnite.Windows.ProgressWindowFactory
19-12 17:40:56.694|INFO|GameDatabase:Opening db C:\Users\Tedd\AppData\Roaming\Playnite\library
19-12 17:40:56.862|DEBUG|ExecutionTimer:--- Timer 'DatabaseLoadCollections', 166 ms to complete.
19-12 17:40:56.879|INFO|DatabaseStats:Completely recalculating database statistics...
19-12 17:40:56.904|DEBUG|WindowFactory:Closing window Playnite.Windows.ProgressWindowFactory, True.
19-12 17:40:57.586|INFO|PlayniteUiHelper:GameActivity - Add Header button
19-12 17:40:57.596|INFO|PlayniteUiHelper:SuccessStory - Add Header button
19-12 17:40:57.596|INFO|GenericWishlist:IsThereAnyDeal - Load from local for Steam
19-12 17:40:57.624|INFO|GenericWishlist:IsThereAnyDeal - Load from local for Gog
19-12 17:40:57.627|INFO|GenericWishlist:IsThereAnyDeal - Load from local for Origin
19-12 17:40:57.627|INFO|PlayniteApplication:Application 8.11.0.21747 started
19-12 17:40:57.891|WARN|PlayniteUiHelper:HowLongToBeat - No data for 1942
19-12 17:41:02.628|DEBUG|Downloader:Downloading string content from http://www.playnite.link/update/stable/info.json using System.Text.UTF8Encoding encoding.
19-12 17:42:38.453|DEBUG|WindowFactory:Show dialog window Playnite.DesktopApp.Windows.SettingsWindowFactory
19-12 17:42:51.565|DEBUG|WindowFactory:Closing window Playnite.DesktopApp.Windows.SettingsWindowFactory, False.
19-12 17:43:14.976|DEBUG|BaseCollectionView:Refreshing collection view filter.
19-12 17:43:15.566|DEBUG|BaseCollectionView:Refreshing collection view filter.
19-12 17:43:50.313|WARN|PlayniteUiHelper:GameActivity - No data for Shin Megami Tensei: Persona 3 Portable
19-12 17:43:53.005|WARN|GenericAchievements:SuccessStory - No game find for Shin Megami Tensei: Persona 3 Portable with d134f8fe9dbdc22143e59e9fab5805aa in PlatformType.All
19-12 17:43:53.861|ERROR|Common:SuccessStory [H:\GitHub\Lacro59\playnite-successstory-plugin\Services\SuccessStoryUI.cs 211] - Error on TaskRefreshBtActionBar()
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at SuccessStory.Clients.RetroAchievements.GetHash(String FilePath, PlatformType platformType) in H:\GitHub\Lacro59\playnite-successstory-plugin\Clients\RetroAchievements.cs:line 417
   at SuccessStory.Clients.RetroAchievements.GetGameIdByHash(Game game, List`1 rA_MD5Lists) in H:\GitHub\Lacro59\playnite-successstory-plugin\Clients\RetroAchievements.cs:line 337
   at SuccessStory.Clients.RetroAchievements.GetAchievements(Game game) in H:\GitHub\Lacro59\playnite-successstory-plugin\Clients\RetroAchievements.cs:line 73
   at SuccessStory.Services.SuccessStoryDatabase.GetFromWeb(Game game) in H:\GitHub\Lacro59\playnite-successstory-plugin\Services\SuccessStoryDatabase.cs:line 158
   at SuccessStory.Services.SuccessStoryDatabase.Get(Guid Id, Boolean OnlyCache) in H:\GitHub\Lacro59\playnite-successstory-plugin\Services\SuccessStoryDatabase.cs:line 73
   at PluginCommon.Collections.PluginDatabaseObject`3.Get(Game game, Boolean OnlyCache) in H:\GitHub\Lacro59\playnite-descriptioneditor-plugin\playnite-plugincommon\Collections\PluginDatabaseObject.cs:line 343
   at SuccessStory.Services.SuccessStoryUI.<>c__DisplayClass51_0.<RefreshElements>b__0() in H:\GitHub\Lacro59\playnite-successstory-plugin\Services\SuccessStoryUI.cs:line 211
19-12 17:44:10.742|INFO|PlayniteApplication:Shutting down Playnite
19-12 17:44:10.742|DEBUG|PlayniteApplication:Releasing Playnite resources...
19-12 17:44:10.742|DEBUG|WindowFactory:Show dialog window Playnite.Windows.ProgressWindowFactory
19-12 17:44:10.809|DEBUG|WindowFactory:Closing window Playnite.Windows.ProgressWindowFactory, True.```
Lacro59 commented 3 years ago

from sofmarch on forum (https://playnite.link/forum/thread-275-post-3015.html#pid3015)

The good news is that after refreshing the RetroAchievements database in Settings the memory issue doesn't happen upon selecting the game anymore, the bad news is that the memory surge still happens when closing out of the game and returning to playnite, but only for a few seconds (around 20-30 maybe?) later it subsides and goes back to roughly normal memory usage, so it might be good enough for now.

I've turned Custom Integration back on, but before I did that I noticed that the Icon button still kept disappearing like I posted earlier.


22-12 18:54:02.296|INFO|ExtensionFactory:Loaded plugin: IsThereAnyDeal, version 1.2.1
22-12 18:54:03.826|INFO|CheckVersion:PluginCommon - MetadataLocal - Find v1.2.1 - Actual v1.2.1
22-12 18:54:03.826|INFO|ExtensionFactory:Loaded plugin: Metadata Local, version 1.2.1
22-12 18:54:04.799|WARN|PluginLocalization:PluginCommon - File C:\Users\Tedd\AppData\Roaming\Playnite\Extensions\playnite-screenshotsvisualizer-plugin\localization\en_US.xaml not found.
22-12 18:54:04.967|INFO|CheckVersion:PluginCommon - ScreenshotsVisualizer - Find v1.2 - Actual v1.2
22-12 18:54:04.967|INFO|ExtensionFactory:Loaded plugin: ScreenshotsVisualizer, version 1.2
22-12 18:54:14.900|INFO|CheckVersion:PluginCommon - SuccessStory - Find v1.3 - Actual v1.3
22-12 18:54:14.900|INFO|ExtensionFactory:Loaded plugin: SuccessStory, version 1.3
22-12 18:54:15.306|INFO|CheckVersion:PluginCommon - ThemeModifier - Find v1.2.1 - Actual v1.2.1
22-12 18:54:15.728|INFO|ExtensionFactory:Loaded plugin: ThemeModifier, version 1.2.1
22-12 18:54:20.196|INFO|ExtensionFactory:Loaded plugin: LBGDB metadata provider, version 2.0.0
22-12 18:54:20.330|INFO|ExtensionFactory:Loaded plugin: RAWG metadata provider, version 2.0.0
22-12 18:54:20.408|INFO|SGDBMetadataSettings:saved settings
22-12 18:54:20.408|INFO|SGDBMetadataSettings:a8989aebe28f0012573963ea66e7bc09
22-12 18:54:20.408|INFO|SGDBMetadataSettings:
22-12 18:54:20.408|INFO|SGDBMetadataSettings:
22-12 18:54:20.408|INFO|ExtensionFactory:Loaded plugin: SteamGridDB Metadata Provider, version 0.5.6
22-12 18:54:20.748|INFO|ExtensionFactory:Loaded plugin: Universal Steam Metadata, version 1.4
22-12 18:54:20.929|INFO|ExtensionFactory:Loaded plugin: Epic Store Library Importer, version 1.0
22-12 18:54:20.977|INFO|ExtensionFactory:Loaded plugin: GOG Library Importer, version 1.0
22-12 18:54:21.000|INFO|ExtensionFactory:Loaded plugin: IGDB metadata provider, version 1.0
22-12 18:54:21.061|INFO|ExtensionFactory:Loaded plugin: itch.io Library Importer, version 1.0
22-12 18:54:21.061|INFO|ExtensionFactory:Loaded plugin: Origin Library Importer, version 1.0
22-12 18:54:21.144|INFO|ExtensionFactory:Loaded plugin: PlayStation Library Importer, version 1.0
22-12 18:54:21.239|INFO|ExtensionFactory:Loaded plugin: Steam Library Importer, version 1.0
22-12 18:54:21.287|INFO|ExtensionFactory:Loaded plugin: Uplay Library Importer, version 1.0
22-12 18:54:21.334|INFO|ExtensionFactory:Loaded plugin: Xbox Library Importer, version 1.0
22-12 18:54:26.642|INFO|ExtensionFactory:Loaded script extension: C:\Users\Tedd\AppData\Roaming\Playnite\Extensions\Game_Media_Tools\GameMediaTools.ps1, version 1.3
22-12 18:54:26.741|INFO|ExtensionFactory:Loaded script extension: C:\Users\Tedd\AppData\Roaming\Playnite\Extensions\Links_Sorter\LinksSorter.ps1, version 1.0.1
22-12 18:54:26.843|INFO|ExtensionFactory:Loaded script extension: C:\Users\Tedd\AppData\Roaming\Playnite\Extensions\Steam_DB_Rating\SteamDbRating.ps1, version 1.0.1
22-12 18:54:26.928|INFO|ExtensionFactory:Loaded script extension: C:\Users\Tedd\AppData\Local\Playnite\Extensions\LibraryExporter\LibraryExporter.ps1, version 1.0
22-12 18:54:27.303|DEBUG|WindowFactory:Show window Playnite.DesktopApp.Windows.MainWindowFactory
22-12 18:54:27.303|DEBUG|WindowFactory:Opening window that was closed previously Playnite.DesktopApp.Windows.MainWindowFactory
22-12 18:54:27.895|DEBUG|WindowFactory:Show dialog window Playnite.Windows.ProgressWindowFactory
22-12 18:54:29.093|INFO|GameDatabase:Opening db C:\Users\Tedd\AppData\Roaming\Playnite\library
22-12 18:54:50.095|DEBUG|ExecutionTimer:--- Timer 'DatabaseLoadCollections', 21000 ms to complete.
22-12 18:54:50.134|INFO|DatabaseStats:Completely recalculating database statistics...
22-12 18:54:50.402|DEBUG|WindowFactory:Closing window Playnite.Windows.ProgressWindowFactory, True.
22-12 18:54:50.646|ERROR|Common:ScreenshotsVisualizer [H:\GitHub\Lacro59\playnite-screenshotsvisualizer-plugin\Services\ScreenshotsVisualizerDatabase.cs 134] - Error on File load for Black Mesa on C:\Program Files (x86)\Steam\steamapps\common\Black Mesa\bms\screenshots
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Collections.Generic.List`1.Enumerator.MoveNext()
   at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at ScreenshotsVisualizer.Services.ScreenshotsVisualizerDatabase.SetDataFromSettings(GameSettings item) in H:\GitHub\Lacro59\playnite-screenshotsvisualizer-plugin\Services\ScreenshotsVisualizerDatabase.cs:line 134
22-12 18:54:54.371|INFO|PlayniteUiHelper:GameActivity - Add Header button
22-12 18:54:54.483|INFO|PlayniteUiHelper:SuccessStory - Add Header button
22-12 18:54:54.483|INFO|GenericWishlist:IsThereAnyDeal - Load from local for Steam
22-12 18:54:54.640|INFO|GenericWishlist:IsThereAnyDeal - Load from local for Gog
22-12 18:54:54.676|INFO|GenericWishlist:IsThereAnyDeal - Load from local for Origin
22-12 18:54:54.715|INFO|PlayniteApplication:Application 8.11.0.21747 started
22-12 18:54:55.124|WARN|PlayniteUiHelper:HowLongToBeat - No data for 1942
22-12 18:54:59.751|DEBUG|Downloader:Downloading string content from http://www.playnite.link/update/stable/info.json using System.Text.UTF8Encoding encoding.
22-12 18:55:30.458|DEBUG|BaseCollectionView:Refreshing collection view filter.
22-12 18:55:39.213|INFO|GamesEditor:Starting Shin Megami Tensei: Persona 3 Portable, 05002a1a-8687-40c2-976b-acd723c5998a, c93bb187-2571-495f-8784-4e18b25ae604, 00000000-0000-0000-0000-000000000000
22-12 18:55:39.213|INFO|GamesEditor:Using generic controller start the game.
22-12 18:55:39.243|INFO|GameActionActivator:Activating game task Emulator: a892720c-5563-47c3-9632-49d707c693e5, 6262578e-81c1-4aed-ab4d-89c08529870d, False,
22-12 18:55:39.243|DEBUG|ProcessStarter:Starting process: C:\Users\Tedd\Documents\Emulators\ppsspp_win\PPSSPPWindows64.exe, "C:\Users\Tedd\Documents\Emulator Games\PSP\Shin Megami Tensei - Persona 3 Portable.iso" , C:\Users\Tedd\Documents\Emulators\ppsspp_win, False
22-12 18:55:39.374|INFO|GameActivity:GameActivity - dataLogging_start
22-12 18:55:39.375|INFO|GamesEditor:Started Shin Megami Tensei: Persona 3 Portable game.
22-12 18:55:53.251|INFO|GameActivity:GameActivity - dataLogging_stop
22-12 18:55:53.251|INFO|GamesEditor:Game Shin Megami Tensei: Persona 3 Portable stopped after 14 seconds.
22-12 18:55:53.359|WARN|PlayniteUiHelper:ScreenshotsVisualizer - No data for Shin Megami Tensei: Persona 3 Portable
22-12 18:55:56.162|WARN|GenericAchievements:SuccessStory - No game find for Shin Megami Tensei: Persona 3 Portable with d134f8fe9dbdc22143e59e9fab5805aa in PlatformType.All
22-12 18:55:59.013|WARN|GenericAchievements:SuccessStory - No game find for Shin Megami Tensei: Persona 3 Portable with d134f8fe9dbdc22143e59e9fab5805aa in PlatformType.SNES
22-12 18:56:01.703|WARN|GenericAchievements:SuccessStory - No game find for Shin Megami Tensei: Persona 3 Portable with d134f8fe9dbdc22143e59e9fab5805aa in PlatformType.SNES
22-12 18:56:02.490|WARN|GenericAchievements:SuccessStory - No game find for Shin Megami Tensei: Persona 3 Portable with 73d1940ed8d0d2e7de6078e03272b62b in PlatformType.Sega_CD_Saturn
22-12 18:56:05.182|WARN|GenericAchievements:SuccessStory - No game find for Shin Megami Tensei: Persona 3 Portable with d134f8fe9dbdc22143e59e9fab5805aa in PlatformType.SNES
22-12 18:56:05.957|WARN|GenericAchievements:SuccessStory - No game find for Shin Megami Tensei: Persona 3 Portable with bf619eac0cdf3f68d496ea9344137e8b in PlatformType.Sega_CD_Saturn
22-12 18:56:05.957|WARN|GenericAchievements:SuccessStory - No console find for Shin Megami Tensei: Persona 3 Portable with Sony PSP
22-12 18:56:05.957|WARN|GenericAchievements:SuccessStory - No game find for Shin Megami Tensei: Persona 3 Portable with Sony PSP in 0
22-12 18:56:44.385|INFO|GamesEditor:Starting Shin Megami Tensei: Persona 3 Portable, 05002a1a-8687-40c2-976b-acd723c5998a, c93bb187-2571-495f-8784-4e18b25ae604, 00000000-0000-0000-0000-000000000000
22-12 18:56:44.385|INFO|GamesEditor:Using generic controller start the game.
22-12 18:56:44.394|INFO|GameActionActivator:Activating game task Emulator: a892720c-5563-47c3-9632-49d707c693e5, 6262578e-81c1-4aed-ab4d-89c08529870d, False,
22-12 18:56:44.394|DEBUG|ProcessStarter:Starting process: C:\Users\Tedd\Documents\Emulators\ppsspp_win\PPSSPPWindows64.exe, "C:\Users\Tedd\Documents\Emulator Games\PSP\Shin Megami Tensei - Persona 3 Portable.iso" , C:\Users\Tedd\Documents\Emulators\ppsspp_win, False
22-12 18:56:44.419|INFO|GameActivity:GameActivity - dataLogging_start
22-12 18:56:44.419|INFO|GamesEditor:Started Shin Megami Tensei: Persona 3 Portable game.
22-12 18:56:59.836|INFO|GameActivity:GameActivity - dataLogging_stop
22-12 18:56:59.836|INFO|GamesEditor:Game Shin Megami Tensei: Persona 3 Portable stopped after 15 seconds.
22-12 18:56:59.972|WARN|PlayniteUiHelper:ScreenshotsVisualizer - No data for Shin Megami Tensei: Persona 3 Portable
22-12 18:57:02.581|WARN|GenericAchievements:SuccessStory - No game find for Shin Megami Tensei: Persona 3 Portable with d134f8fe9dbdc22143e59e9fab5805aa in PlatformType.All
22-12 18:57:05.339|WARN|GenericAchievements:SuccessStory - No game find for Shin Megami Tensei: Persona 3 Portable with d134f8fe9dbdc22143e59e9fab5805aa in PlatformType.SNES
22-12 18:57:08.001|WARN|GenericAchievements:SuccessStory - No game find for Shin Megami Tensei: Persona 3 Portable with d134f8fe9dbdc22143e59e9fab5805aa in PlatformType.SNES
22-12 18:57:08.777|WARN|GenericAchievements:SuccessStory - No game find for Shin Megami Tensei: Persona 3 Portable with 73d1940ed8d0d2e7de6078e03272b62b in PlatformType.Sega_CD_Saturn
22-12 18:57:11.479|WARN|GenericAchievements:SuccessStory - No game find for Shin Megami Tensei: Persona 3 Portable with d134f8fe9dbdc22143e59e9fab5805aa in PlatformType.SNES
22-12 18:57:12.196|WARN|GenericAchievements:SuccessStory - No game find for Shin Megami Tensei: Persona 3 Portable with bf619eac0cdf3f68d496ea9344137e8b in PlatformType.Sega_CD_Saturn
22-12 18:57:12.196|WARN|GenericAchievements:SuccessStory - No console find for Shin Megami Tensei: Persona 3 Portable with Sony PSP
22-12 18:57:12.196|WARN|GenericAchievements:SuccessStory - No game find for Shin Megami Tensei: Persona 3 Portable with Sony PSP in 0```