godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.21k stars 21.22k forks source link

Disable V-Sync mode, memory leak occurs when running the project. #99269

Open xixipig19960424 opened 3 days ago

xixipig19960424 commented 3 days ago

Tested versions

System information

Godot v4.3.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Laptop GPU (NVIDIA; 32.0.15.6590) - 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 Threads)

Issue description

Version: Godot v4.3.stable.mono / Godot v4.3.stable Issue Description: When I set Project -> Project Settings -> Display -> Window -> V-Sync -> Disabled, a memory leak occurs after running the project, with a rate of approximately 2MB every 5 seconds. This bug also occurs even when there is only a single Node2D in the scene. Please refer to the demonstration video for more details. video

Steps to reproduce

Steps to reproduce the issue:

  1. Go to Project -> Project Settings -> Display -> Window -> V-Sync -> Disabled
  2. Run any project
  3. Observe the memory usage of the process

Minimal reproduction project (MRP)

"N/A"

matheusmdx commented 3 days ago

I tried to reproduce this with a simple scene for 10m, but except from the expected high GPU usage everything else was normal, no memory increase.

Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated AMD Radeon RX 580 2048SP (Advanced Micro Devices, Inc.; 31.0.21921.1000) - AMD Ryzen 5 3600 6-Core Processor (12 Threads)


Also your link is wrongly formated, you could just copy paste the link or if you want to use the link formatting the order is title link, you put in the opposite order and click in the video link just open another github tab.

image

xixipig19960424 commented 2 days ago

@matheusmdx Hello, I have fixed the video link. You can take a look at it. This memory leak cannot be observed in Debugger -> Monitors -> Memory -> Static, but in Windows Task Manager -> Processes, you can see it increasing at a rate of approximately 2MB/5s.

mrjustaguy commented 2 days ago

Unable to reproduce on an AMD Radeon RX 6600 with current drivers (24.10.1) in my 3D game project, despite running at 2560x1440 at an impressive and a bit surprising ~300 fps for a good while.

Given that so far the other failed reproduction was also on AMD, This is probably an Nvidia Driver bug, though more testing is needed to confirm or bust that theory.

matheusmdx commented 2 days ago

@xixipig19960424 Yes i looked from task manager but i didn't saw any memory leak

xixipig19960424 commented 2 days ago

@matheusmdx @mrjustaguy I just tested with two GPUs, the RTX 4060 and Intel Iris(R) Xe, under the same environment. The memory leak also occurred on the RTX 4060 but not on the Iris(R) Xe. Additionally, the issue appears when using Vulkan but not OpenGL. This leads to a preliminary conclusion that the problem is related to the Vulkan implementation in NVIDIA's GPU driver.

xixipig19960424 commented 1 day ago

A supplementary note: Another possibility is that the Vulkan interface in the Godot engine is relatively outdated. Many thanks to the experts for analyzing this further.