cemu-project / Cemu

Cemu - Wii U emulator
https://cemu.info
Mozilla Public License 2.0
7.05k stars 540 forks source link

Toon tanks memory leak #1265

Open Triticum0 opened 1 month ago

Triticum0 commented 1 month ago

Current Behavior

The game suffers from a memory over time will crash the emulator

Expected Behavior

Cemu not being 7GB in size.

Steps to Reproduce

  1. Load game
  2. start on the first mission
  3. play until you start to see the memory balloon

System Info (Optional)

OS: Windows 10 GPU: NVIDIA GeForce RTX 3060 Ti CPU: AMD Ryzen 7 5700X 8-Core Processor

Emulation Settings (Optional)

default settings

Logs (Optional)

Toon Tanks.txt

Squall-Leonhart commented 1 month ago

Using memory is not the same thing as leaking memory, using 7GB is not unheard of in openworld titles like botw, especially using OpenGL (Which you are). Does the same behavior manifest under vulkan, or does this cause graphical issues?

Exzap commented 1 month ago

I can't replicate this. For me it stays around 1.4GB memory usage. Can you explain in more detail what you are doing in the game exactly (which missions?) and how fast memory usage increases

Squall-Leonhart commented 1 month ago

an opengl memory leak was reported to occur between 472.12 and 536.40 when utilising glMaxShaderCompilerThreadsARB in July 2023, it is possible this has been fixed post 545.

Mentioning this because the OP is using 536.23

Triticum0 commented 1 month ago

I updated to the latest drivers and retested on my Linux iso didn't prevent the memory leak. Took 10 mins to get to 2.7 GB on Windows on Linux got to close to 12 GB before opening Steam by mistake and Cemu dropped to 8 GB in a matter of seconds. so it has nothing to do with the drivers on the original log or the os.

Triticum0 commented 1 month ago

Also completed the game so will post a save file if needed, not sure if I can though. also affected more than just toon tanks so I don't think it's game-specific, more of a driver issue being my guess. If you need to give more information from the emulator just tell me what to do to help troubleshoot. Also didn't affect any emulated games in my testing

Triticum0 commented 1 month ago

here the save if anyone needs it. 101a4400.tar.gz

Exzap commented 1 month ago

Did you try switching to Vulkan?

Triticum0 commented 1 month ago

yes the Linux test as Vulkan is set by default on a fresh install

Squall-Leonhart commented 1 month ago

interestingly, the Eu version doesn't render with OpenGL, only with Vulkan

Theres no leak going on though, the working sets operate within the limits of the commit size and the commit size grows and shrinks, i'd expect commit to grow perpetually if memory was leaking.

Every square tile the tank interacts with is a 4k added to the heap, mines placed is another 4k, the tank turning, etc.

This is just cemu retaining data to use later, if you start the same mission twice, it'll only show a pocket of growth on the first time, and on the second time only if either tank does something that wasn't in the first run.