RAM usage grows to several GB if terminal with continuous logs is left running for several hours after closing the browser tab #6413
Unanswered
josephrocca
asked this question in
General
Replies: 1 comment
-
From what I recall VS Code replays the terminal history so it has
this "catching up" behavior.
But, the history appears to have a limit of 1 MB so I am not sure
what is going on.
That is the extent of my knowledge though, the folks upstream
probably know more. Definitely sounds like a bug.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
TL;DR: code-server seems to try to remember all the logs since you last opened the page, which can lead to a huge amount of RAM usage - in my case 2GB after leaving the terminal running, then closing the browser tab, then coming back in the morning.
Reporting this here since I can't report as a bug in issues without ticking "cannot reproduce in VSCode/Codespaces", and I haven't tested the former yet. Will try to get around to it eventually but for I figure there's a chance a contributor/dev will see this and understand what's going on here (assuming that it is indeed a bug).
code-server --version
: 1.80.1 74f6148eb9ea00507ec113ec51c489d6ffb4b771 x64Context:
I recently updated from a very old version to a recent version, and noticed that there's a cool new feature where if you close the code-server browser tab, and then open it back up, the terminal is still going, and e.g. if you were running a program that outputs a stream of logs, that stream is still going when you open the tab to connect to code-server again.
One thing I did find strange is that when I open the tab it spends a while "catching up" - i.e. the logs are flying past very quickly for several seconds, and then it gets to the latest/"live" point in the stream and continues from there at a normal pace. Sometimes there'd be so much "catching up" to do that the logs would be screaming past, and then the terminal would freeze up, and I'd have to click the trash icon to kill it.
Problem:
Today when I woke up I noticed that my server was at 98% RAM utilization, and so I opened up code-server, and it turns out I'd closed the tab when a command was still running, and code-server seems to have been "remembering" those logs all night. The terminal was frozen so I clicked the trash icon, and then the RAM usage went back down to normal. It was using about 2GB.
Here's what I imagine would be a minimal reproduction, based on what I've observed, but note that I haven't tried this yet - I'm hoping that from the above explanation it's clear to the devs what's happening here.
code-server
, start a terminal, and run a program in the terminal that outputs lots of logs continuously and quickly.Beta Was this translation helpful? Give feedback.
All reactions