Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak #90

Open
1 task done
Readek opened this issue Apr 15, 2024 · 3 comments
Open
1 task done

Memory leak #90

Readek opened this issue Apr 15, 2024 · 3 comments
Labels
bug Something isn't working priority - urgent

Comments

@Readek
Copy link

Readek commented Apr 15, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Affected Build(s)

2109

Description of Issue

When playing, the emulator has a small memory leak (about 1MB per second), which becomes an issue when in long sessions (for example, streaming). Tested in Pokemon Y 1.0 and Pokemon X 1.5. Latest Citra, latest Lime release, and even PabloMK7 build all present this issue.

Attached log uses vulkan renderer, though the issue is still present when using OpenGL. This is happening on Linux. I haven't tested on Windows. Log goes up to 1GB before closing the emu.

Expected Behavior

Citra's RAM not consuming my entire PC.

Reproduction Steps

Literally just opening a game and letting it run without doing anything else.

Log File

citra_log.txt

System Configuration

CPU: AMD Ryzen 5 7600 (12) @ 5.170GHz
GPU/Driver: AMD 7600XT
RAM: 32GB DDR5
OS: Arch Linux

@OpenSauce04 OpenSauce04 added bug Something isn't working priority - urgent labels Apr 15, 2024
@OpenSauce04
Copy link
Member

Note to self: Check if perf_history has anything to do with this

@Readek
Copy link
Author

Readek commented May 16, 2024

Be sure to check out this same issue but on PabloMK7's repo, where there's a bit more info about it.

@SeppNel
Copy link
Contributor

SeppNel commented Mar 18, 2025

As @suDisdain previously discovered, the leak happens because libfaad expects NeAACDecClose to be called after NeAACDecInit.
It seems to me like the proper way to fix it would be to reopen the decoder if we detect that the game is playing a new aac file.

I am not familiar, nor experienced enough with the code base to do that but as a workaround we can just run NeAACDecInit once since games don't seem to change sample rate or number of channels, although some games may brake.

I tested Pokemon X and also briefly Fire Emblem Echoes: Shadows of Valentia and both seem to work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority - urgent
Projects
None yet
Development

No branches or pull requests

3 participants