Cubed-Development / Modern-Warfare-Cubed

Welcome to the official GitHub Repository for Modern Warfare Cubed!
Apache License 2.0
92 stars 59 forks source link

GPU, RAM and VRAM usage spike when having v-sync, uncapped fps, bloom turned on and game is minimized #364

Open Drakexman opened 6 months ago

Drakexman commented 6 months ago

Describe the bug

Copied from my discord message for consistency sake: Shaders, turning bloom on, to be exact causes memory leak. But only if i have game minimized both in fullscreen with alt+tab, or just the regular way if windowed. This happens only when fps is set to uncapped AND V-sync is on. Game stays at stable fps, yet memory usage is rapidly going up on task manager at a rate between 30-300mb per second, faster when staring at sun in game, and depending how many mods is installed. Normally in vanilla this is capped at maximum ram allocated to minecraft, but in this case it goes past that. Turning off bloom or capping fps at any rate other than unlimited fixes this. Also just a few seconds after alt+tabbing there's this spike in GPU usage to 100% and starts to accumulate VRAM the same way (i can even hear my vents in GPU going like crazy second after this). When optifine is installed it happens when fps is set to V-sync OR uncapped. Probably because of only one slider. Tested after clean reinstallation of minecraft, forge, java and graphics drivers update.

Reproducibility

Screenshots and/or videos

https://imgur.com/a/wJT1NhI

Logs

https://mclo.gs/lw2YyZV

Debug Logs

No response

Crash Reports

none, as game didn't crash

MWC Version

0.1 Dev 20

Forge Version

2860

Red Core Version

0.6 Dev 2

MixinBooter Version

9.1 or none. Tested on both

Java Version

1.8 401

Java Virtual Machine

Hotspot

Operating System

Windows 10

GPU Vendor

NVIDIA

Code of Conduct

Desoroxxx commented 6 months ago

I need more info:

Right now from what I am seing in your screenshot nothing looks too crazy, especially if you do not have optimization mods.

Drakexman commented 6 months ago

VRAM and RAM usage seems to not stop, only slow down after some time. I've just killed process after it went over 50 gb of RAM, and about 20 gb of VRAM usage. This of course is rising until minecraft tab is selected again. Then usage stays in place, and after capping FPS starts to very slowly return to normal values.

Amount of RAM allocated for this test was 4 gb. When testing with 25 mods installed (Mostly JEI, Optifine, LoliASM, Better FPS, Waila) or with 85 mods (wchich after not loading MWC had stable 3-4 gb RAM utilisation) i had the same problems, but usage was accumulating a lot faster. The same fix could be applied. Optimization mods helped with initial RAM/VRAM usage, but not after presumed memory leak. For most of the test with other mods i had 12 gb of ram allocated

Also judging by your response you only got one of the screenshot provided. Sorry if that was the case https://imgur.com/MQFB2r4 https://imgur.com/Z2oLPTv https://imgur.com/qleCjjz

I sent log and screenshots only with those two mods to rule out compatibility issues.

Desoroxxx commented 6 months ago

I did get all of the screenshots but they don't seem off chart, but what you said does, I will investigate, although it may not arrive until 0.2 devs builds or maybe 0.1.1

Drakexman commented 6 months ago

No problem. I understand that it's not a priority, especially with an easy temporary fix. But bug is a bug, and it's better when documented :)

Desoroxxx commented 6 months ago

No problem. I understand that it's not a priority, especially with an easy temporary fix. But bug is a bug, and it's better when documented :)

Thanks for the report

Desoroxxx commented 6 months ago

Especially the testing, most people would have just said that there was a memory leak and leaved it at that

Drakexman commented 6 months ago

Well i'm a programmer too so i know how it is. At first i thought problem is on my side, but by sheer luck i found out it's connected to fps cap. Then went for every single shader option to check which excacly is colliding. Sadly i'm not experienced in Java so couldn't find out anything interesting in logs, and without crashlog there's not much to see anyway. I can also make some new tabs for minor or not majorly game breaking bugs, but i wouldn't want to spam github. Good luck, and i'm waiting for beta on 13th

Desoroxxx commented 6 months ago

I can also make some new tabs for minor or not majorly game breaking bugs, but i wouldn't want to spam github.

Don't worry, as long as you do a quick check to see if no one opened a similar issue before, we would be very happy with more bug reports.