Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High WindowServer memory usage over time #128

Open
BienGudBoy opened this issue Oct 16, 2024 · 6 comments
Open

High WindowServer memory usage over time #128

BienGudBoy opened this issue Oct 16, 2024 · 6 comments
Labels
needs investigation Further investigations need to be performed

Comments

@BienGudBoy
Copy link

BienGudBoy commented Oct 16, 2024

The longer borders run, the higher WindowServer memory usage would be. One time (about 1 - 2 days of uptime) I catched it using almost 4GB of memory, while borders itself only took like 500MB. Stopping and restarting borders releases the memory instantly - WindowServer from 4GB+ -> 500MB.

I didn't manage to get the screenshot though. Is there a way to fix this?

Edit: Here's my bordersrc:

#!/bin/bash

options=(
        style=round
        width=6.0
        hidpi=on
        active_color=0xffd893a8
        inactive_color=0xff4a4e5c
)

borders "${options[@]}"```
@FelixKratz
Copy link
Owner

I think it probably has to do with the hidpi option. With it disabled, I have never seen any memory problems in window server.

@FelixKratz FelixKratz added the needs investigation Further investigations need to be performed label Dec 9, 2024
@maximkhatskevich
Copy link

maximkhatskevich commented Dec 15, 2024

Same here. After installing Aerospace with JankyBorders I noticed when I watch a YT video in Safari with just 4 tabs open the video starts to lag sometimes. I opened ActivityMonitor and saw the top CPU consumer was WindowsServer at 36%. After disabling and uninstalling the borders, I restarted and now the video plays smooth even at 1.75x speed in same browser with same windows open with same Aerospace config, and ActivityMonitor shows CPU consumption for WindowsServer is just 17-18%. It's definitely an issue.

ENV: macOS 14.6.1 (23G93), Apple Air M1, 16 GB memory.

My bordersrc was:

#!/bin/bash

options=(
  style=round
  width=3.0
  hidpi=on
  active_color=0xff39FF14 # neod green, default - 0xffe2e2e3
  inactive_color=0x00000000
)

borders "${options[@]}"

UPD: tried with hidpi=off in same exact conditions, the video seems to be fine and not lagging, which is good, but ActivityMonitor steel shows WindowsServer consuming again between 29 to 42% (avg. around 37% most of the time) of CPU again, which is unacceptable on a not so powerful machine like mine, and the borders look noticeably pixelated at the corners ofc.

P.S. useful utility, thanks for your hard work, I hope you can fix the issue and I'll give it a try again in the future.

@FelixKratz
Copy link
Owner

Does this also happen when not using aerospace at the same time?

@maximkhatskevich
Copy link

Does this also happen when not using aerospace at the same time?

That is a good question, maybe Aerospace also contributed and after adding borders it was already over the threshold and became noticeable, indeed. I'll test "borders" with Aerospace disabled, with just normal macOS setup.

@maximkhatskevich
Copy link

Does this also happen when not using aerospace at the same time?

That is a good question, maybe Aerospace also contributed and after adding borders it was already over the threshold and became noticeable, indeed. I'll test "borders" with Aerospace disabled, with just normal macOS setup.

So the results are interesting. I've enabled borders with same config as before with hdpi=on, my MacBook Air M1 is connected to same 5K2K external monitor and I played YouTube video in second Safari window in my internal screen while using main Safari window on my big main monitor for surfing (no Aerospace whatsoever).

While Activity Monitor, actually, showing CPU load averageing between 36 and 42% load again, it does not show in any way, the system GUI is still smooth and video does not get stuck or loose frames, etc. If I'd never look in Activity Monitor - I'd never know the CPU usage is up again.

So it's not CPU alone issue, nor it's borders alone issue as well. Even though borders on it's own does not make much use without keyboard centric tiling manager. If I manage windows with mouse - I pretty much sense which window is active now, no need for borders.

@FelixKratz
Copy link
Owner

I use yabai and have never encountered such problem personally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation Further investigations need to be performed
Projects
None yet
Development

No branches or pull requests

3 participants