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

🐞 scrolling becomes delayed system wide after loop is running for a long time #626

Open
3 of 4 tasks
8pxl opened this issue Dec 9, 2024 · 16 comments
Open
3 of 4 tasks
Labels

Comments

@8pxl
Copy link

8pxl commented Dec 9, 2024

Bug Description

after loop runs for awhile, the scrolling system wide becomes delayed.

Steps To Reproduce

The issue arises as long as loop is running (even if it isn't being used)

restarting loop temporarily resolves the issue, but it returns after some time period (usually around 10 minutes, but haven't timed precisely)

Expected Behavior

Scrolling should not be delayed

Actual Behavior

Scrolling is delayed after running the app

Screenshots

No response

macOS Version

Sonama 14.5

Loop Version

1.1.1

Additional Context

No response

Final Checks

  • My issue is written in English
  • My issue title is descriptive
  • This is a single bug (multiple bugs should be reported individually)
  • I can help with fixing or developing this issue (tick if you can help).
@8pxl 8pxl added the Bug label Dec 9, 2024
@8pxl 8pxl changed the title 🐞 [weird scroll issue after loop is running for a long time] 🐞 weird scroll issue after loop is running for a long time Dec 9, 2024
@8pxl 8pxl changed the title 🐞 weird scroll issue after loop is running for a long time 🐞 scrolling becomes delayed system wide after loop is running for a long time Dec 9, 2024
@SenpaiHunters
Copy link
Collaborator

What type of scrolling (app(s) other items)? You noted "system wide," have you also made sure its Loop, and not another process, or loop subprocess? And, after 10 mins, isn't a "long time" has Loop ever risen in memory? As, slow scrolling is mostly your CPU or Memory being pegged.

@8pxl
Copy link
Author

8pxl commented Dec 10, 2024

I waited until the issue occurred again, which happened after about 20 hours (my 10 minute estimate was heavily recency biased...)
I'm not sure how to confirm that Loop is causing this, but I assumed it was since closing Loop resolves the issue.

heres a video of the scrolling delay (i'm just scrolling normally but the page is jumpy)

Screen.Recording.2024-12-09.at.8.29.48.PM.mov

screenshot of cpu usage while the issue is occurring
image

and immediately after closing Loop (resolving the issue)

image

@SenpaiHunters
Copy link
Collaborator

SenpaiHunters commented Dec 10, 2024

I more wish for you to focus on memory, you'll see Arc use a tonne of it, but normally it'd be CPU/memory or both, in the screenshots shared, it doesn't look like Loop is the cause. WindowServer being the biggest macOS trash in years, finder, mds, spotify, arc, only thing may be AXVisuals, but that's very unlikely. The video, it's not really massively clear, and could be just a spike, uhh, we'll have to investigate it more. But, if you can share memory + cpu screenshots when you're having the issues, that'd be awesome.

I'll also add to this, please update to the dev builds, i wish to test if it's also an issue on a newer build, as you've noted you're using 1.1.1

003190-12@2x

@lukasesch
Copy link

I got a similiar issue, but it's mostly appearing when moving windows around with the mouse, or resizing them.
They are dragging behind the cursor with almost a 1 second delay.
The longer loop is running, the bigger the issue gets. In my case it needs to be longer than 10 minutes though. Can't put an exact time on it.
I'll try to take screenshots of memory + cpu when the issue occurs again.

Setup is M1 Macbook Pro (Base Version) attached via USB C Dock to a 4k and 2.5k screen.
Maybe having two different scaled displays could be part of the issue?

My fix is the same as 8pxl's. Restarting (or closing in general) Loop instantly fixes the issue for some time.
Dev version is installed since quite some time and the issue was always there.
Loving Loop so I don't mind restarting, nonetheless it starts becoming more annoying.

Thanks if the bug can be found and fixed!

@greg1075
Copy link

greg1075 commented Jan 18, 2025

Same here. I experienced the same issue where system animations (e.g. moving / resizing windows, scrolling, etc.) became progressively choppier over time. Rebooting my system would temporarily resolve the problem, but it would gradually reappear the next day (I rarely shut down my MacBook Pro overnight).

Initially, I thought it was a macOS bug. However, I just realized that I haven’t encountered the issue in the past week, which coincides with my switch to Swish. For context, I occasionally alternate between Loop, Swish, and Rectangle Pro...

I run macOS 15.2 (24C101) on an M4 Pro MBP, but had the same problem on the M1 Pro I had before that.

@greg1075
Copy link

I wanted to confirm the above. Running Loop regularly again, and after a few hours, system starts getting choppy and draggy. Cursor movement, web page scrolling, moving/resizing windows... Quitting Loop fixes the problem instantly. The problem gets worse over time. Maybe a memory leak of some sort?

@MrKai77
Copy link
Owner

MrKai77 commented Jan 24, 2025

@greg1075 it could indeed be a memory leak. Are you also running the latest version of Loop? We recently fixed a memory leak related to the event monitor, which might address the issue. Additionally, I’ve been exploring some private APIs that avoid mouse event tracking entirely, and I’m considering integrating those into Loop in the future to improve performance further (although I am still seeing it if has any disadvantages compared to our current method).

@greg1075
Copy link

@greg1075 it could indeed be a memory leak. Are you also running the latest version of Loop? We recently fixed a memory leak related to the event monitor, which might address the issue. Additionally, I’ve been exploring some private APIs that avoid mouse event tracking entirely, and I’m considering integrating those into Loop in the future to improve performance further (although I am still seeing it if has any disadvantages compared to our current method).

I am running the latest beta version 1.3.0 (1445).

@SenpaiHunters
Copy link
Collaborator

I'm not going to lie, when i say, i've got 0 idea as to why this is happening for 3 people, and how loop is causing this, and the activity monitor from 8pxl makes no sense because loop is calling none of those programs or events. Plus, it'd be RAM (Memory) i'm interested in, not CPU

@greg1075
Copy link

I'm not going to lie, when i say, i've got 0 idea as to why this is happening for 3 people, and how loop is causing this, and the activity monitor from 8pxl makes no sense because loop is calling none of those programs or events. Plus, it'd be RAM (Memory) i'm interested in, not CPU

That is bizarre. It happened to me on two separate systems including a brand new computer i.e. fresh OS , so that pretty much rules out a system-specific issue. It could very well be that more people are running into the issue but haven't reported it? I'm gonna let Loop run and see if I can identify any RAM pressure in the activity monitor.

@MrKai77
Copy link
Owner

MrKai77 commented Jan 25, 2025

It could very well be that more people are running into the issue but haven't reported it?

I would agree that this is very probable, despite not being able to reproduce it myself.

I'm gonna let Loop run and see if I can identify any RAM pressure in the activity monitor.

That would be greatly appreciated!

I also suspect that this bug might be related to Loop’s cursor event tracking for window snapping, even though it doesn’t seem directly connected to scrolling. Here’s a build with all of that functionality removed. The option will still appear in Loop’s settings, but it won’t actually do anything: Loop.zip
It would be great if you could test this build to see if the bug still occurs! If it does, I’ll be able to rule out one potential cause of the issue.

@greg1075
Copy link

The problem started reappearing after about 36 hours. Quitting Loop fixed it immediately. I'm including screenshots of my entire activity monitor with Loop still running (10 total) and after quit (9).

Loop running:

Image Image Image Image Image Image Image Image Image

After quit:

Image Image Image Image Image Image Image Image Image

@SenpaiHunters
Copy link
Collaborator

Okay, @greg1075, i can (after i was finished recovering from being blinded...) see Loop shot up to 200 ish mbs of ram, defs should not happen, so there is a leak somewhere, @MrKai77 linked a download above for a stripped version of one of the monitors, can you please download and use that so we can rule out any issues / problems.

I'm shocked because my loop runtime is over a week and its only at 80mb with all sorts of movements i've done, so maybe theres something macOS version related too, causing something to leak which didnt before.

@greg1075
Copy link

@SenpaiHunters - Sorry for the onslaught of screenshots. I wasn’t sure exactly what you’d be looking for, so I sent everything.

Also, sorry for not being clear earlier - the activity monitor data above was captured while using the version @MrKai77 linked to above: 1.2.0 (1445).

@SenpaiHunters
Copy link
Collaborator

Ah, okay, so it's something unrelated to mouse events, are you using any custom keybinds? All i can think is something is not being dislocated or misallocated elsewhere, and have you noticed anything strange while using loop? Currently, the main dev build chain is on Version 🧪 1.3.0 (1445), so even after those changes its something else, interesting (the version will be out because of how builds are done, but don't worry, it'll still work).

Alright, it's something we'll need to debug, thanks for the info and screenshots.

@greg1075
Copy link

@SenpaiHunters I use 3 custom keybinds, one for window centering which I changed to CMD-[`], Almost Maximize which I changed to CMD-2. and a custom cycle with several (centered) window sizes set to CMD-1.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants