Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weird memory leak issue with OpenGL
10-23-2021, 06:11 PM
Post: #1
Question Weird memory leak issue with OpenGL
I'm having what appears to be a weird memory leak issue when using OpenGL on any PSP title. Both Vulcan and Direct3D are working fine without issue.

It keeps building up memory usage until reaching 14-15GB, and then crashes.
The weird thing is, that if I enable "Show debug statistics", the increase in memory stops. Disabling the statistics resumes the increase in memory usage.

Does anyone have a clue what could be causing this?

Specs:

AMD Ryzen 9 3950X
32GB RAM, DDR4 3600MHz
RTX 2080 Ti

Please let me know if more info is needed, I would really like to solve this issue.
Find all posts by this user
Quote this message in a reply
10-24-2021, 04:19 AM
Post: #2
RE: Weird memory leak issue with OpenGL
Could you try enabling the setting in developer tools to log frame drops? It'd be useful to know if this stops the memory usage too, although that isn't a fix. That setting does some, but not all, of the things show debug statistics does.

If that doesn't help, it almost has to be something about UI. Does it matter if FPS is displayed or not? This could be somehow graphics driver related.

Otherwise, if it also helps, it would have to be related to tracking data which is strange.

It'd also help if you could try the latest git build, as well as a pretty old version like v1.3.x:
https://github.com/hrydgard/ppsspp/releases/tag/v1.3

This will be buggier, but if it doesn't have these problems, at least we can tell it was introduced at some point. If it still has these problems, I'm really going to expect either a driver issue, or some sort of plugin like reshade/etc.

-[Unknown]
Find all posts by this user
Quote this message in a reply
10-24-2021, 06:43 AM
Post: #3
RE: Weird memory leak issue with OpenGL
I tested enabling the log frame drops, but it didn't change anything.

However, enabling the FPS counter does indeed stop the memory usage from increasing.

I was already running the latest build, 1.12.3, which has the issue.
But as suggested, I also downloaded the linked 1.3 version and tested things there. No increase in memory usage in that version.
I also tested the games in the latest build of Retroarch with OpenGL (no FPS counter enabled or anything else), no constant increase in memory usage happening there either.

So could this still be a graphics driver issue?
Find all posts by this user
Quote this message in a reply
10-25-2021, 12:49 AM
Post: #4
RE: Weird memory leak issue with OpenGL
Using an NVIDIA card and a recent git build, I tried the same settings (I almost always have the FPS counter enabled so I was worried maybe there was some glitch I didn't notice.) I played Persona 3 a bit with an HD texture pack installed. Memory usage didn't really go above 200 MB.

So I do think this might be some kind of driver issue, but it's interesting that v1.3 didn't have it.

If you could try a few older versions here (i.e. maybe 1.7, and then either one more newer or older depending on if that one has the issue), that might give more an idea when it happened:
http://ppsspp.org/downloads_all.html#windows

Ultimately, even if it's a driver bug, if there's something we started doing that's triggering it... we may be able to stop doing that thing. Or at least do something else. That said, driver bugs can be tricky beasts.

-[Unknown]
Find all posts by this user
Quote this message in a reply
10-25-2021, 05:11 AM
Post: #5
RE: Weird memory leak issue with OpenGL
Having tested a few versions, here is what I found:

1.7/1.7.1/1.7.4 are all working perfectly fine without any issues.
1.8 and onward is where the issue appears and the memory usage keeps increasing, unless enabling debug statistics or the FPS counter.
Find all posts by this user
Quote this message in a reply
11-17-2021, 02:59 PM
Post: #6
RE: Weird memory leak issue with OpenGL
Update on this issue:

I ran DDU and reinstalled the Nvidia drivers, and the memory leak no longer happens.
Still not sure why the memory issue never happened in the older versions.

Anyway, issue resolved and everything works.
Find all posts by this user
Quote this message in a reply
11-16-2022, 10:31 AM
Post: #7
RE: Weird memory leak issue with OpenGL
I am having this exact same issue. My RAM usage just keeps going up and up until it cant take anymore and then ppsspp just freezes and shuts off with no warning or error displayed. When it doesn't crash, it seems to hover at around 22GB of RAM usage for a while, then randomly crashes when playing the game. Once it reaches about 24GB, the program just freezes and closes.

If I pause the game, or nothing is happening on screen, the amount the memory raises slows greatly, or stops completely until there's activity on screen again. It's almost like its writing to memory, and then not ever cleaning anything out once it's done. It just keeps going and going until there's no memory left to use and it crashes.

Turning on show fps, or debug statistics also stops ram raise for me as well like described above. The second I turn them back off, the ram usage continues to soar. I certainly do not want to play with these things covering the screen.

I also tried multiple versions of the emulator. All of the 1.7 versions worked fine for me as well, as soon as I got to 1.8, the issue is present from that point on just like for the original poster.

This is only happening when using OpenGL for me. DirectX stays at around 200MB on average. I am not sure why OpenGL wants to use 24GB+. I do not want to use DirectX, I want to use OpenGL.

I tried what the poster here said fixed it for them. Using DDU, and reinstalling Nvidia drivers did not fix it for me like it supposedly did for them.

Any idea whats going on, or how to fix this? I would like to be able to use the emulator without constant crashing.
Find all posts by this user
Quote this message in a reply
11-17-2022, 05:02 AM
Post: #8
RE: Weird memory leak issue with OpenGL
Please try the latest git build.

With the largest Person 3 HD texture pack, you could get into a situation where memory use would grow significantly (mostly because the textures are really unnecessarily high resolution... but also because of how the game works.) It may not fix this for you if there's a driver issue, but it may reduce the memory use.

The latest git build keeps track of how much HD texture data has been loaded and throws it away more aggressively for large texture packs so you don't run out of RAM.

-[Unknown]
Find all posts by this user
Quote this message in a reply
11-27-2022, 12:31 PM (This post was last modified: 11-27-2022 12:58 PM by DarkDream787.)
Post: #9
RE: Weird memory leak issue with OpenGL
Unless git build means something other than the newest version of the emulator available, I was doing just that. I was already using the latest build of the emulator, and tried many other versions of it as well.

I think it was an issue with more recent Nvidia drivers, and compatibility with the emulator. I have the most recent Nvidia driver installed on my computer. I spent hours changing one driver setting at a time in Nvidia Control Panel, and after lots of trial and error with different combinations of changes, there was only one fix that I could find. I narrowed it down to one single setting causing this issue for me.

There is an option in the Nvidia Control panel called Threaded Optimization. It can be found in the Manage 3D Settings part of the Nvidia control panel. I changed it from the default setting of Auto to Off. The issue stopped right after I did that. If I tried setting it back to Auto, or changing it to On, the issue persisted, and the memory problem was back again.

I have another computer I built years ago with a much older version of Nvidia Drivers installed. It's version 419.35 and released on 03/05/2019 according to information in the software on my older computer. This is not an issue at all on that computer. I can use any version of PPSSPP emulator, and this never happens. I can have that same option set to Auto, On, or Off, and this is never a problem on the computer with the older Nvidia driver installed. This has lead me to believe the issue is driver based, and the PPSSPP emulator version 1.8 or newer, does not like the newer Nvidia drivers for some reason when running it with OpenGL. Particularly that one setting.

I tried this on a friends computer who was just recently built, and it had the same exact issue as me. It was also fixed by changing that same exact setting on their computer as well.

In the end, I have solved the issue with a possible performance hit due to disabling that setting, but it seems to be running well so far without any noticeable lag as of yet. I have not noticed the setting change impacting the emulators performance in any way yet, but I will test it out more.
Find all posts by this user
Quote this message in a reply
11-27-2022, 01:10 PM
Post: #10
RE: Weird memory leak issue with OpenGL
It should not have performance hit, PPSSPP does it's own multithreading to avoid situation from the past where Nvidia was way ahead of other vendors due to their drivers, might even work better with it off.

That being said, I can't reproduce the problem on my system either. Maybe your drivers are messed up, it's wise to remove drivers completely before updating, through most people never bother and just express install new ones. I recall even having old drivers from different vendor can mess things up(ie. if you had AMD gpu in the past and now have Nvidia or the other way around and never fully removed old drivers). Could also be something completely different that you're enforcing via drivers which we don't and it only causes issue when combined with the option you found, but that one is on auto by default and would affect many people if it was to blame on it's own, which it doesn't.

http://forums.ppsspp.org/showthread.php?tid=6594 - Custom PPSSPP Shaders!
http://forums.ppsspp.org/showthread.php?tid=3590&pid=117172#pid117172 - simple CE scripts to help creating CWCheats,
https://github.com/LunaMoo/PPSSPP_workarounds - CWCheat workarounds.
Find all posts by this user
Quote this message in a reply
11-27-2022, 03:12 PM
Post: #11
RE: Weird memory leak issue with OpenGL
PPSSPP has stable releases (i.e. v1.13.2) and git builds (available often multiple times a day.) The current git build has almost 2000 improvements in it compared to v1.13.2.

https://buildbot.orphis.net/ppsspp/

-[Unknown]
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: