-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Terminal gets extremely sluggish after a day of use #7710
Comments
@lminer (or anyone else seeing this): A dump would be helpful in trying to find the root cause for this issue. You can capture one using Task Manager by right-clicking on WindowsTerminal.exe in the Details tab. Thanks! |
Just for the record, I'm seeing this as well. I opened a duplicate issue, not realizing this one was already here. I'll try |
Do you mean the "create dump file" option? |
How do I send it to you? The files are big |
@zadjii-msft , you can download a dump file and a video showing the issue from this link: https://we.tl/t-Q9SG7e5z6r Note that the dump file is 1GB uncompressed, which is a lot of memory usage for a terminal. In task manager, I could see 700MB of memory usage, dropping to 70MB after restarting the terminal. |
@zadjii-msft I can only get this to happen reliably when SSH-ed into a few work servers. In case the dump file contains potentially sensitive data, is there an email address where I can send it? |
I've just had a (long overdue) 4 day holiday. Coming back to my desktop session, Windows Terminal was extremely slow. |
I get this consistently as well, and have for months. I know I shouldn't be leaving terminal windows open over night, but it really shouldn't be a problem either :-) This seems to happen on multiple unrelated Windows 10 installs. E.g. a work AD joined workstation and also my personal Dell PC, and personal homebuilt 7 year old PC. |
I have same problem |
I also have the same problem. |
I consistently see this issue (raised as #8640 above) on a machine we use to run some production scripts. Will report further findings here. |
Same issue in both 1.4 release and 1.5 prerelease with WSL1 (Ubuntu 18.04) on my Kaby Lake era desktop build. The issue seems to occur after a few days, closing the terminal (which itself takes up to 10 seconds sometimes) and reopening it fixes the issue. I leave a terminal open constantly (with constant irssi activity). Edit: because it was brought up below, my terminal usage is also single tab with an ssh+tmux session |
I found that no issue occurs when using terminal with only single tab. I have opened a single-tab terminal for 2 weeks, but no speed problem found while opening new tab or tab switching. Opening multi-tab terminal for a long time may be the cause of this issue. |
My experience is that keeping a single tab only makes the problem shows up slower. After a couple of days it still becomes sluggish when I try to copy from the terminal. My workaround now is to keep a single terminal tab, launch a tmux server in WSL, switch sessions in tmux, and restart the terminal when it's sluggish. |
No problem! We can all agree babies are vastly more interesting than memory leaks :) Indeed the link has expired, and I'm searching high and low but can't the original file anywhere. |
PS: is there a way I can send you the link privately? |
Sure thing, my email is in my profile |
Tried Terminal again after a while, wanted to do some comparison/screen recording, all was good and before moving on I went to the kitchen to get me some coffee. When I came back, my notebook fans were to the max, so opened my task manager and saw this on the "3D" chart: So, I slowly closed first Chrome, then Spotify and eventually, Terminal, take a look: |
@zadjii-msft , I've sent you a new dump over WeTransfer, dit you receive it? Primary "symptom" I'm seeing is slow tab switching, like a second of delay. After restarting Terminal, tab switching is instant again. |
Sounds like my issue.. Most times I only have one tab open with a SSH session to my server and windows terminal will be using 1.6GB of ram and very slow to respond to clicks and eventually slow to even type in the terminal. |
Experiencing the same issue using WT Preview V 1.7.572.0. I am also a heavy user of tmux (through WSL2). Clearing the history does nothing. Killing tmux does nothing. It gets slower over time and/or due to the amount of text output in the terminal. For me at least. Opening a new window (not tab) of WT Preview seems to make it work normally, but the other Windows (which I kept open) is still "sluggish". So this is not a critical issue, but it's extremely annoying. |
Reported the same issue separately - my mistake. Here's my summary and diagnostic data. Hope it helps get this resolved. Definitely an annoyance, though Windows Terminal has been a huge win in my workflow. Windows Feedback link for diagnostic data: https://aka.ms/AAbj0dj |
I think I have an idea on this. I need to capture allocation traces for |
TerminalControl!<lambda_8050e662c890fd8b88061e60f2bb6336>::operator()+0x6d [E:\BA\3\s\src\cascadia\TerminalControl\ThrottledFunc.h @ 62] and Something about the pattern they're using is making an extra ref/instance that never gets let go and just consumes more and more over time... |
## Summary of the Pull Request ThrottledFunc previously created a DispatcherTimer whose Tick callback holds a strong reference to the DispatcherTimer itself. This causes a reference cycle, inadvertently leaking timer instances. ## PR Checklist * [x] Closes #7710 * [x] I work here ## Detailed Description of the Pull Request / Additional comments I've initially wanted to remove the `ThrottledFunc<>` optimization, but it turns out that this causes a 3% slowdown. That's definitely not a lot, but enough that we can just keep the optimization for the time being. I've moved the implementation from the .cpp file into the header regardless since the two implementations are extremely similar and it's easier that way to keep them in line. ## Validation Steps Performed I've ensured that the scrollbar still updates its length when I add new lines to a newly created tab.
## Summary of the Pull Request ThrottledFunc previously created a DispatcherTimer whose Tick callback holds a strong reference to the DispatcherTimer itself. This causes a reference cycle, inadvertently leaking timer instances. ## PR Checklist * [x] Closes #7710 * [x] I work here ## Detailed Description of the Pull Request / Additional comments I've initially wanted to remove the `ThrottledFunc<>` optimization, but it turns out that this causes a 3% slowdown. That's definitely not a lot, but enough that we can just keep the optimization for the time being. I've moved the implementation from the .cpp file into the header regardless since the two implementations are extremely similar and it's easier that way to keep them in line. ## Validation Steps Performed I've ensured that the scrollbar still updates its length when I add new lines to a newly created tab. (cherry picked from commit faf372f)
This sounds very promising! I'm getting about 6 hours of work before I have to |
Well, the next release is already scheduled for sometime next week, so probably not? We'd want to selfhost it internally too and make sure we didn't accidentally make this worse 😅 |
This bug is very serious. I Many programmers need the terminal running for a long time in order not to lose state, but it becomes unusable after several days. |
@panicfarm then you'll be happy to know that the root cause was found and should be fixed in the next preview build |
🎉This issue was addressed in #9729, which has now been successfully released as Handy links: |
Fantastic ! Great work team-terminal :-) |
🎉This issue was addressed in #9729, which has now been successfully released as Handy links: |
So far, so good, at least on an SSH connection I left open to a work server for 24 hours. I did notice that things quickly got sluggish in the settings window, of all places, though I have no idea if the cause is the same. Still, at least the actual terminal part seems to be working much better. Thank you to those who put in the work to solve this one. |
I noticed a marked improvement, but still find my terminal getting into sluggish mode. I most frequenly notice it when lots of lines displaying on a remote ssh session (i.e., cat big logfile). the latest WSLTTY doesn't get sluggish with the same test. |
I'm finding that if I use Windows Terminal for more than a day, it starts to get extremely sluggish: there is a lag in opening and closing new tabs and a lag in switching between tabs and a lag in typing. This problem immediately resolves itself if I close the application and restart it.
I'm not sure how to give a more detailed bug report. I tried downloading WPR, but it errored out when I tried to make a recording.
My setup is as follows: I'm using the beta version of Terminal, running WSL2 with ubuntu 20.04. I'm on the insider branch of Windows 10 with CUDA support for WSL2 enabled. My laptop is a Razer Blade advanced 2019 4K with an nvidia 2080 mobile graphics card.
The text was updated successfully, but these errors were encountered: