PiP icon indicating copy to clipboard operation
PiP copied to clipboard

WindowServer high memory usage

Open caiisen opened this issue 10 months ago • 2 comments

When I use picture-in-picture with an application window, WindowServer memory usage will constantly increase over time, peaking at 30+Gb and causing my mac to force quit. The more picture-in-picture windows I have open, the quicker the memory usage increases. The memory occupied is not released even after I closed PiP.

MacBook Pro M1pro, macOS 15.3.1

caiisen avatar Feb 18 '25 13:02 caiisen

I am on macOS 12.7.6, and have never seen any memory leaks in WindowServer.

A Few questions that may help

  • Is this behaviour specific to macOS 15.3.1?
  • Does the WindowServer memory usage increase only when using pip to mirror windows?

If the leaks are reproducible, it may be because private/undocumented apis are used to mirror windows. CGDisplayStream apis are used to mirror displays and is an official way to achieve it. This should not contribute to the observed memory leaks.

amitv87 avatar Feb 19 '25 11:02 amitv87

Thank you for your reply. I've just started using pip and don't know how it's performed on other system versions, but no one seems to have reported this problem before. According to my observation, WindowServer will also fluctuate in daily use, but it only takes up so much memory when using pip. I found that it seems that using native pip won't cause memory leaks, but I can only have a window with native pip at most. I will continue to observe this situation and then synchronize other new discoveries.

caiisen avatar Feb 20 '25 03:02 caiisen