TASEmulators / TASEmulators/BizHawk
[Mupen64Plus] Loading ROMs Multiple Times Causes Memory Leak
- Dominant language
- C#
- Stars
- 2.8k
- Forks
- 468
- PR merge metrics
- No merged PRs in 30d
Description
Summary
During an instance of Bizhawk running, opening any ROM while using the Mupen64Plus core will cause memory to be loaded that is not cleared when either closing the ROM or using "Reboot Core". The only way to remove the memory usage is to close the istance of Bizhawk.
This appears to have been introduced in 5a8ce91d9550e82ff9e90c5569f045548041f284 , where the DLLs were recompiled for VS2022 as well as had the dependencies updated.
I tested in the latest upstream version (Mupen64Plus v2.6.0) with no issues, but as stated in their release note here the packages used were built with VS2019, so I'm unsure if it working correctly there correlates.
Repro
- (Optional) Disable rewind if it is enabled so as not have to wait for it to fill its buffer
- Load any ROM with the Mupen64Plus core
- Close the ROM or select "Reboot Core"
- Repeat steps 2-3 while taking note of Bizhawk's memory usage in Task Manager
Below are two images showcasing Ocarina of Time (USA) both on first load and after using "Reboot Core" 10 times.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing linked pull request #4117 and the change that recompiled the Mupen64Plus DLLs for VS2022. Reproduce the leak by repeatedly loading a ROM and closing it or selecting “Reboot Core,” while monitoring memory usage. Done means repeated cycles no longer cause unbounded memory growth.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100