-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Memory Issue when continually using Nushell #7127
Comments
Two things that I can think of that would be helpful in figuring this out are this. When you see this problem again, please report back with the output of these commands.
and
|
For the sake of testing, I let the affected terminal run in the background since I posted this issue. Faulty Terminal
┏━━━━━━━━━━━━━━┳━━━━━━━━━┓
┃ source_bytes ┃ 1971920 ┃
┃ num_vars ┃ 23147 ┃
┃ num_commands ┃ 2968 ┃
┃ num_aliases ┃ 2500 ┃
┃ num_blocks ┃ 9302 ┃
┃ num_modules ┃ 148 ┃
┃ num_env_vars ┃ 39 ┃
┗━━━━━━━━━━━━━━┻━━━━━━━━━┛
String {
val: "one",
span: Span {
start: 1971925,
end: 1971928,
},
} Fresh Terminal
┏━━━━━━━━━━━━━━┳━━━━━━━┓
┃ source_bytes ┃ 87640 ┃
┃ num_vars ┃ 955 ┃
┃ num_commands ┃ 573 ┃
┃ num_aliases ┃ 103 ┃
┃ num_blocks ┃ 468 ┃
┃ num_modules ┃ 7 ┃
┃ num_env_vars ┃ 35 ┃
┗━━━━━━━━━━━━━━┻━━━━━━━┛
String {
val: "one",
span: Span {
start: 87645,
end: 87648,
},
} The "fresh" terminal was kept open since I created this issue, though I haven't done anything with it, yet. Weirdly enough, the RAM consumption in the faulty terminal has not sunken a single bit, yet the performance in terms of speed is back again. I do not notice any speed issues anymore, when testing the same commands I tested for this issue, in the first place. Feels like a queue of some sorts cleared up in the meantime. Still, even then, the RAM consumption is precisely the same as before. |
I think this is a known issue that when spans get large, nushell slows down. It sounds like that's what is going on. |
Is there already an issue associated with this problem? |
There may be an issue, I haven't looked. Easily? Probably not. I think it may require some type of garbage collection. |
Is the source of the issue known and solvable or is it undetermined, yet? |
I'm no expert but I believe this is known. I think it's because none of these ids get reused. If you create a thing, then up arrow and edit it to tweak something, then do that again, you've created 3 ids instead of just having 1 that was edited twice. That's my layman's description. |
Describe the bug
This is a vague observation. Not sure, how to investigate.
When playing around in Nushell, the terminal gets slower, slower & slower...
The memory used by
/usr/bin/nu
is1.0 GiB
& virtual1.5 GiB
. I can confirm the1.5 GiB
with various external Linux tools.The CPU usage seems overly high for a terminal, as well.
How to reproduce
let-env
,def
,$env
,$nu
and further Nu features.Expected behavior
No CPU, memory & performance issues should arise just from doing something in the shell.
Screenshots
No response
Configuration
Additional context
Platform
Debian GNU/Linux 11 (bullseye) in WSL2 on Windows 10
Terminal software
Visual Studio Code integrated Terminal
Nushell is running "natively" as a login shell.
Opening a new Nu terminal does not have these issues. The issues just arise after playing around with a single instance for quite a while.
The text was updated successfully, but these errors were encountered: