-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Description
On macOS, when a wgpu+winit program's window is fully occluded by other windows:
- Its memory usage is increased by a few gigabytes.
- The number of threads it uses is also increased.
- Builtin Apple apps don't usually trigger this, other apps like vscode, chrome, blender can trigger it.
- The memory increased seems to be related with the size of the command buffer. For example, if there is no render pass, there is basically no memory increase; if there is 1 pass, it uses around 1.2G; if there are 2 passes, it uses around 1.7G.
- The issue still exists after I reboot the system.
- If you bring the occluded wgpu+winit window back to the front, the memory usage will drop back to within 1G, but still a few times higher than the initial memory usage, probably because the memory allocator doesn't totally release those memories back.
Repro steps
- Run example
02_hello_windowin wgpu repo. - Open another window, or bring a maximized window to the front (use the apps listed in the 3rd point of Description to trigger the issue more easily).
Expected vs observed behavior
The total memory used by the wgpu program is increased by around 1GB.
Extra materials
I can provide a screen recording demonstrating the process if you want.
Platform
macOS 26.2
rust version: 1.93.0
wgpu version: 28.0
winit version: 0.30.12 (or 0.30.8 for the reproduction example)
AdapterInfo { name: "Apple M4", vendor: 0, device: 0, device_type: IntegratedGpu, device_pci_bus_id: "", driver: "", driver_info: "", backend: Metal, subgroup_min_size: 4, subgroup_max_size: 64, transient_saves_memory: true }Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Todo