I've found a reliable way to reproduce this issue. I was working with Metal 3 to port my game engine to macOS, and noticed major memory leaks while resizing the application window. After hours of debugging I figured I might just revisit the "Hello Triangle" example directly from Apple. That leaked memory too.
So, for anyone with the will to reproduce this issue:
- Obtain the official "Hello Triangle" Metal example from using_a_render_pipeline_to_render_primitives
- Use a MacBook (maybe a Mac Studio is also affected?) with external monitors.
- Resize the "Hello Triangle" window on an external monitor.
A few notes:
It does not happen when resizing the application on the built-in monitor.
My monitors are both 4K@240Hz (32GS95UE-B), which may be another factor important for this?
I am using HDMI 2.1 on one and DP 1.4 on the other, and both suffer from this issue.
The issue disappears if I comment out the `presentDrawable` call in the "Hello Triangle" example.
I would also like to make clear that I have resized the official "Hello Triangle" example application so much, that it ended up locking up my system (making my cursor stutter, music choppy, and inevitably freezing forcing me to do a full restart).
Hopefully this information allows for a prompt fix. I also own a Mac Studio with an M2 Ultra, which I will be testing this on shortly, so I might edit or follow up to specify if this is a laptop-specific issue.