goatcorp / Dalamud

FFXIV plugin framework and API
GNU Affero General Public License v3.0
1.18k stars 271 forks source link

FPS loss over extended play session (memory leak?) #619

Closed DAOWAce closed 2 years ago

DAOWAce commented 3 years ago

I don't know if this is due to the launcher, Dalamud system or one of the plugins I'm using, or even a game update (unlikely), but ever since I've started using the launcher after coming back to the game, I've noticed worsening performance the longer the game runs, similar to the effects of a memory leak. I think it's due to dalamud/plugins, because I don't recall that system existing in the early days of the launcher (or at least different; as Rich Presence was part of the launcher, not an installable plugin), and I also don't recall worsening performance, and I regularly left the game running for multiple days at a time back then.

I typically leave the game up overnight, and when I start playing the next day I noticed the framerate is lower than expected, which is how I discovered the issue. Upon restarting the game, performance is restored to expected levels (20%+ fps boost).

This performance loss is gradually happening even after a couple hours. It's not much, but without gsync enabled and being sensitive to framerate changes, it's quite noticeable when things worsen (as my 1080 Ti runs the game just above my monitor's refresh rate). Restarting the game every couple hours is not a welcome solution.

I've been meaning to uninstall all the plugins I have and just run the launcher stock overnight to fully test this issue, but it's nearing a week and I still haven't gotten around to it, so I wanted to submit this report in hopes other people have experienced the issue and can shed light on the cause.

Steps to reproduce the bug:

1. Use the launcher
2. Enable plugins (?)
3. Record current framerate
4. Leave character logged in for multiple hours
5. Notice worsened framerate
6. Restart game and notice originally recorded framerate (depending on zone congestion)

Expected behavior: No impact to performance.

Other information: Operating System: Windows 10 v1703 XIVLauncher version: Latest version(s). Launching as admin?: System is admin account; this is forced. Using Steam?: No Addons/Plugins enabled: Chat Bubbles, 'ez' plugins, Good Memory, RezPls, Simple Tweaks, SlideCast, The Great Separator

goaaats commented 3 years ago

Thanks for the report, we can't troubleshoot this at the moment, as our development version of the addon is quite far ahead of what regular users use now. This will change on the 10th of October, so I'd ask you to please try this again once the new version of the addon is released and see if you can still get this to happen.

DAOWAce commented 3 years ago

So having tested with the new v6 version and running the client for almost 48h straight, and joining the discord and browsing through people's troubles, I think I have a guess as to the problem.

Some plugins are not executing their code correctly and causing issues behind the scenes. The most obvious is an instant-CTD due to .net terminating the game client (event ID 1023).

For me specifically, I started having CTD's before v6 released, oddly starting October 5, when I had been playing for a couple weeks before that just fine. I don't know what changed and navigating logs didn't really provide me with much answer.

These are what show up in event viewer:

v5:

Application: ffxiv_dx11.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an internal error in the .NET Runtime at IP 00007FFD1F419880 (00007FFD1F410000) with exit code 80131506.

v6:

Application: ffxiv_dx11.exe
CoreCLR Version: 5.0.621.22011
.NET Version: 5.0.6
Description: The process was terminated due to an internal error in the .NET Runtime at IP 00007FFD65F21863 (00007FFD65EE0000) with exit code 80131506.

The plugin that was triggering this for me was Chat Bubbles. With it disabled, I had no crashing, nor did I have any memory leak-esque issue. As soon as I re-enabled it, the client CTD'd with that same error within a minute; and this was after a complete cleaning of the launcher to root out any remnants.

Reading through discord, it seems this CTD is also being triggered by a few other plugins. Character Data Sync and Sound Filter being pointed at a lot.

Is there a way we can get a list compiled of what plugins are safe and what are causing this .net runtime error to figure out where in the code it's tripping up? As a non-dev end user I don't really have a good way to handle any of this (and can only make guesses anyway).

goaaats commented 2 years ago

The plugin authors are aware of this, so I'll close this issue as it isn't directly related.