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

Video/Storyboard leaks memory #31873

Closed
PercyDan54 opened this issue Feb 13, 2025 · 15 comments
Closed

Video/Storyboard leaks memory #31873

PercyDan54 opened this issue Feb 13, 2025 · 15 comments
Labels
missing details Can't move forward without more details from the reporter type:performance

Comments

@PercyDan54
Copy link
Contributor

Type

Performance

Bug description

By repeatedly opening beatmaps with video/storyboard the memory keeps increasing
Happens on all renderers

Screenshots or videos

Found this on a 30 min session retrying a map with storyboard
Image

Repro:
https://youtu.be/SfJ8uF6uvbk

Version

2025.118.3

Logs

1739418922.runtime.log

@peppy
Copy link
Member

peppy commented Feb 13, 2025

How much ram is 48.7% in the first place? I'm not sure if you're intentionally trying to omit details but you're doing a good job 😅😅

  • Link beatmap used
  • Close osu!framework stats overlay (this may hold references)
  • Try changing to another beatmap or leaving song select, which should clean things up
  • Try using default skin
  • Specify if it's storyboard of video that is the issue (it's probably not both)

@PercyDan54
Copy link
Contributor Author

PercyDan54 commented Feb 13, 2025

How much ram is 48.7% in the first place? I'm not sure if you're intentionally trying to omit details but you're doing a good job 😅😅

I have 32GB of RAM so 48.7% is 15.58GB. (I was not intentionally emitting details, but seems Windows just displays percentage in that "running out of RAM" page

  • Link beatmap used

1st beatmap (video only): https://osu.ppy.sh/beatmapsets/696697#osu/1475668
2nd beatmap (storyboard only): https://osu.ppy.sh/beatmapsets/292083#osu/657519

  • Close osu!framework stats overlay (this may hold references)
  • Try changing to another beatmap or leaving song select, which should clean things up
  • Try using default skin

None of these helped

  • Specify if it's storyboard of video that is the issue (it's probably not both)

Should be both, as I used a video only and sb only map to test

@peppy
Copy link
Member

peppy commented Feb 13, 2025

Can't reproduce on macOS at least.

@peppy
Copy link
Member

peppy commented Feb 13, 2025

Can't reproduce on windows.

Please start by updating your graphics drivers and unloading any overlays you may have loaded. It might be something external causing this.

@peppy peppy added the missing details Can't move forward without more details from the reporter label Feb 13, 2025
@CloneWith
Copy link
Contributor

CloneWith commented Feb 13, 2025

I managed to reproduce this issue on Windows 11, using a local release version of our latest branch, with a total available memory of about 16GB (32GB in total). I used Auto mod to play these maps and use shortcut key to quickly restart for multiple times.

Memory Graph

Memory Graph

After switching ruleset or exiting replay screen, the memory occupied won't be released and kept going up. And when I loaded about 75~80 maps, it used up all of the memory, causing the system to kill some processes.

It seems like something wrong with resource loading and garbage collecting.

@bdach
Copy link
Collaborator

bdach commented Feb 13, 2025

@CloneWith More memory usage != memory leak. It may indicate one, but it is not necessarily one.

Unless you can show which objects specifically are leaking from the dumps, your graphs don't prove anything or help resolve the issue at all, if there is one to resolve.

@smoogipoo
Copy link
Contributor

smoogipoo commented Feb 13, 2025

Are you all using Direct3D11 (or "Automatic") in the in-game renderer settings? I'm aware of memory leaks in that renderer, and have made efforts in the past to resolve it but it may not be complete. If so, try using OpenGL.

@astro-angelfish
Copy link

it seems not reproducible on Arch Linux, with version 2025.118.3-lazer. mine is stabilized at around 266MB memory after about 10 retries on the same map

my renderer was OpenGL (Experimental) if it does effect.

@peppy
Copy link
Member

peppy commented Feb 13, 2025

There has to be something more here that is being omitted. I cannot reproduce using the same beatmaps over tens of loads using Direct X on windows.

Maybe a skin element, maybe a setting, maybe a specific driver or overlay.

Image

After switching ruleset or exiting replay screen, the memory occupied won't be released and kept going up. And when I loaded about 75~80 maps, it used up all of the memory, causing the system to kill some processes.

If you've gone as far as taking profiling showing a potential issue, would you be willing to share that via email? [email protected]

@PercyDan54
Copy link
Contributor Author

PercyDan54 commented Feb 13, 2025

By doing as the video I can get Gen2 to stack up to gigabytes

Image

Image

Snapshot 1: Just launched, entered song select.
Snapshot 2: Entered a map without storyboard for some seconds and quit
Snapshot 3: Repeat entering map with storyboard

After Snapshot 3 I did a force GC which helped, but there is still some more "unmanaged memory" than the two previous snapshots

@peppy
Copy link
Member

peppy commented Feb 13, 2025

This is normal. There's nothing to learn here. Sure, storyboards need optimisation but this is tracked elsewhere and it's not a leak.

Image

They are being cleaned up as required.

@CloneWith
Copy link
Contributor

I've scanned my custom rulesets, and found one that may cause this problem. After removing that GC could work as normal again... So not a really big deal I think? 😣 Or it is a device-specific issue...

@PercyDan54
Copy link
Contributor Author

I don't have proper knowledge so I want to ask. I don't see it being cleaned up (by osu itself), it just stacks up indefinitely over long sessions and potentially consumes tens of gigabytes, maybe run a GC when the session is too long and the player is idle?

@bdach
Copy link
Collaborator

bdach commented Feb 13, 2025

maybe run a GC when the session is too long and the player is idle

That's the .NET runtime's job. The only case where I can see it being our job is if the changes to GC mode that we do to get better GC behaviour during gameplay somehow do not revert correctly.

@peppy
Copy link
Member

peppy commented Feb 14, 2025

Closing for now as working-as-intended.

@PercyDan54 if you manage to get the 16 gb memory usage happening again, please perform a process memory dump from task manager and send a copy over.

@peppy peppy closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
missing details Can't move forward without more details from the reporter type:performance
Projects
None yet
Development

No branches or pull requests

6 participants