ppy / osu-stable-issues

Report critical osu-stable issues here
59 stars 11 forks source link

[Memory leak bug](Added recurrent video) Infinite loading map or unresponsive issues #1197

Open wanjiaXG opened 6 months ago

wanjiaXG commented 6 months ago

Unfortunately, I am unable to provide a fixed process for reproducing the problem at this time. My friends and I have noticed that as long as the osu has enabled the video background, the following three problems will occur.

These issues are not caused by fixed maps, they occur irregularly.

  1. In solo: There will be an infinite loading map. At this time, as long as Alt+F4 exits, and then set to disable the video background in Graphics-detail settings, it can be loaded. At this time, this also can be exited using Alt+F4, and after restart osu, select the same map can also be loaded.

  2. In Editor osu! will appear unresponsive, and at this point, the process must be terminated by going to the task manager, after restart osu, select the same map can also be loaded. also can set to disable the video background in editor-general to avoid this problem from happening.

  3. In multiplayer Similar to the situation in solo, infinite loading of maps. At this time, as long as one user client encounters this problem, everyone's client will load infinitely. If used !mp abort, then the user who triggers unlimited loading will be forcibly taken offline. At this time, you can also choose to turn off the video background or restart osu to re-join the multiplayer room.

If the video background is turned off, the above problems will not occur. As for whether it is caused by the video background, I am not very sure, but as long as the video background is turned off, it will no longer appear, which makes me feel related to it.

This problem has been going on for a long time, at least about 3 years. Before, I thought it was a problem with my computer because I couldn't find a way to trigger it 100%.

This year, I found that my friends also encountered this problem. When they turned off the video background, this problem never occurred again.

wanjiaXG commented 6 months ago

By the way, a suggestion, could you please separate the video background in the editor from the storyboard switch? Currently, disabling video background will also disable storyboard. If possible, I hope it can be set separately like gameplay.

wanjiaXG commented 6 months ago

In Solo, my friend and I tried to reproduce this problem after more than an hour of experimentation After starting OSU, use NF+DT mod, open the map with video background, and let it automatically finish playing, continuing to open the map with video background. It can be opening the same map every time, or it can be opening different maps every time. Finally, you will find that the memory usage of osu will continue to increase without decreasi. After each playback, approximately 5-10M of memory will be added until the problem of infinite loading occurs.

wanjiaXG commented 6 months ago

In my test, OSU only played 2 sets of maps. I played these two songs separately and then continued to loop through this step. The memory increased from 200-300m to 1GB, and finally, infinite loading occurred.

wanjiaXG commented 6 months ago

Video preview: https://www.youtube.com/watch?v=nLCiT-IkD7I

wanjiaXG commented 6 months ago

Testing environment

  1. use osu stable 20231219.2
  2. There are only 2 Mapsets in the Songs folder (https://osu.ppy.sh/beatmapsets/1802079 and https://osu.ppy.sh/beatmapsets/2066269 respectively)
  3. Use default skin

Testing tools

  1. dotMemory
  2. taskmgr

Testing method add NFDT(Not necessary, add DT is just to speed up testing),Afterwards, take turns clicking on two songs, and switch between songs after each song is fully played.

Result During my 130th test, infinite loading occurred

In the end, another problem was discovered Every time you click on unlimited map loading, a portion of the memory leaks out After pressing ALT+F4 to exit and re-enter, you can quickly see the changes in memory leakage

Because at the end of the test, my computer crashed, so there is no more content left behind.

If you need a full video, I can also provide it, which is 2 hours and 25 minutes.

Play Count: 1 aa 00_00_29_44 Still001

osu! memory: About 300MB Unmanaged memory: 261.3MB

Play Count: 130 aa 00_02_07_32 Still002

osu! memory: About 2.3G Unmanaged memory: 2.1G

wanjiaXG commented 6 months ago

One way to accelerate testing is to add a large number of maps to the Song folder. Taking me as an example, my Songs folder has 2.6w mapsets. When OSU starts, the memory has already occupied about 1.2g. Compared to the above example, I may encounter this problem within 30-60 minutes. QQ截图20231228230638

smoogipoo commented 6 months ago

Can you take a dump, compress it, and email it to pe@ppy.sh with this issue mentioned? It would help better than screenshots.

wanjiaXG commented 6 months ago

Can you take a dump, compress it, and email it to pe@ppy.sh with this issue mentioned? It would help better than screenshots.

I can provide the dump later, but I won't test it the same way again because it will take too long and I don't want to test it again.

I will use a relatively fast method to reproduce this problem and try to dump you the three situations I mentioned earlier, including infinite loading and unresponsive.

wanjiaXG commented 6 months ago

Can you take a dump, compress it, and email it to pe@ppy.sh with this issue mentioned? It would help better than screenshots.

Now I have sent all the files to pe@ppy.sh.

I have reproduced the three issues I mentioned earlier and have dumped the memory after each error, including infinite loading, unresponsive editor, and multiplayer disconnection. I have also recorded a video of the entire process of dumping. In the file I sent, there are a total of 4 files, including the dump files and videos that went wrong three times. The files are a bit large, and after decompression, they size 7.17GB.

Coppertine commented 2 months ago

I notice this mostly happens with mp4 files being loaded on the map. The effect itself varies extremely between each computer. This could also happen for videos using a different method of encoding than expected from osu!.

wanjiaXG commented 2 months ago

I notice this mostly happens with mp4 files being loaded on the map. The effect itself varies extremely between each computer. This could also happen for videos using a different method of encoding than expected from osu!.

When I convert MP4 to FLV, it will solve the Infinite loading problem, but the memory leak problem still exists.

Anyway,thank you for your reply. This will provide me with a solution to my most troublesome problem of infinite loading.

As long as the mp4 video is changed from ffmpeg to flv and the suffix is changed to mp4, I think it can alleviate my current problem.

ffmpeg -i video.mp4 -c:v copy video.flv rm video.mp4 mv video.flv video.mp4