warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
20.88k stars 355 forks source link

High Memory Usage #2611

Open sullo opened 1 year ago

sullo commented 1 year ago

Discord username (optional)

No response

Describe the bug

Warp uses a significant amount of memory for a terminal. After using it for a day with 3-5 tabs open (sometimes closing and sometimes opening new ones):

image

After I close all tabs memory drops in half but is still 200MB

image

To Reproduce

Use Warp with multiple tabs.

Expected behaviour

Better memory management. When closing all tabs, memory should reduce to the lower (but still surprisingly high) 100MB which is what happens on start.

Screenshots

No response

Operating System

None

OS Version

Monteray 12.5.1

Shell Version

zsh 5.8.1 (x86_64-apple-darwin21.0)

Warp Version

v0.2023.01.31.08.08.stable_02

Additional context

No response

Does this block you from using Warp daily?

No

Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e

None

dannyneira commented 1 year ago

Thanks for letting us know, by any chance are you using any unsupported plugins in your rc files?

https://docs.warp.dev/help/known-issues#configuring-and-debugging-your-rc-files

sullo commented 1 year ago

I have oh-my-zsh enabled but I have just disabled it and will see how it goes.

wzxu commented 1 year ago

Just to chime in. Using the latest v0.2023.02.21.08.03.stable_01, I get 300MB memory usage freshly launched doing nothing. Kinda insane it uses more RAM than say Hyper, a terminal app build in Electron, which is supposedly as bad as it goes.

image image
davidtinker commented 1 year ago

I have been running Warp on my Mac for a few weeks now with 20-30 tabs and it is now using 7G. I really don't want to have to close it to free that up. Maybe add an option to clear all blocks for all tabs or something?

vorporeal commented 1 year ago

Thanks for the feedback! Warp's memory consumption is something I'm working on; there should be some improvements to memory usage in the release coming out this Thursday, but there's certainly a lot more work we can do to improve things.

@davidtinker It's not as convenient as a "clear all blocks for all tabs" option, but you can hit "cmd+k" in a tab and clear all of the blocks in that tab. If you do that in all of your tabs and it doesn't drastically reduce memory usage, please let me know because that would be very concerning.

davidtinker commented 1 year ago

Cmd+k on all tabs cut memory from 7.2G to 2G. Thanks!

jomifepe commented 1 year ago

+1 on this, my swap is getting obliterated. This is what happens to me almost every time I unlock my mac and left warp open.

Screenshot 2023-03-01 at 14 32 54

vorporeal commented 1 year ago

Holy moly that's bad. @jomifepe How long was Warp open for, in total, since you launched it? If you haven't restarted it yet, mind grabbing a process sample (from "Sample Process" in the ... menu in the Activity Monitor toolbar) and sharing it with me?

jomifepe commented 1 year ago

Holy moly that's bad. @jomifepe How long was Warp open for, in total, since you launched it? If you haven't restarted it yet, mind grabbing a process sample (from "Sample Process" in the ... menu in the Activity Monitor toolbar) and sharing it with me?

It has been open for about two days, but I often shut down the mac at the end of the day.

This is something that happens for about 15 seconds after waking the mac from sleep, warp freezes, as it spikes very high in memory usage and it then comes down to the normal.

Here's a Sample Process when it was "normal" (about 1.5GB). I'm not able to get it to spike really high right now, but I'm gonna try to get it once it happens.

vorporeal commented 1 year ago

Gotcha. Well, today's release (now live via autoupdate) makes some changes relating to memory usage which might fix this for you; give it a shot and let me know if it's any better.

jomifepe commented 1 year ago

Here are some more Sample Processes from memory spikes that I got:

vorporeal commented 1 year ago

Yep, that's about where I expected the issue to be. (We're spending a lot of time handling changes to the window size, which appears to happen on unlock.) I'll be starting on memory usage and resizing performance in earnest next week; might take a little while to make the necessary changes (rewriting some core data structures), but should improve things substantially.

jomifepe commented 1 year ago

Yep, that's about where I expected the issue to be. (We're spending a lot of time handling changes to the window size, which appears to happen on unlock.) I'll be starting on memory usage and resizing performance in earnest next week; might take a little while to make the necessary changes (rewriting some core data structures), but should improve things substantially.

That's great to hear, looking forward to those changes 🚀

thoughtlessmind commented 1 year ago

I am facing the same issue. I've 5 open tabs and it is taking 2GB.

image

although clearing the terminal logs using cmd + K drastically brought down the memory usage to 842mb.

muescha commented 1 year ago

to have more insight which tabs use many memory it would be nice to have a tab manager ( Tab Manager #2881)

lrondanini commented 1 year ago

same here, cmd+k cut the mem from 3G to 200M

sandeepcmsm commented 1 year ago

+1. even with 3 to 4 tabs goign for 2GB RAM, I have switched back to iterm for time being until this gets fixed.

brockelmore commented 1 year ago

any update here? 😅 cmd+k may work but ideally i wouldn't have to worry about this. This is 2 windows, total of 5 tabs

Screen Shot 2023-04-09 at 3 32 10 PM
vorporeal commented 1 year ago

@brockelmore Whoa! How long had it been since you last restarted Warp?

brockelmore commented 1 year ago

@brockelmore Whoa! How long had it been since you last restarted Warp?

A few days - notably after running CLI app that produces a lot of text output many times fwiw

etodanik commented 1 year ago

Reporting similar issues with 700mb+ RAM usage. I was wondering why my laptop was freezing and turns out Warp was gobbling memory

bcmcq commented 1 year ago

+1 - Just spent some time hunting down what was slowing my machine and it lead me here.

2GB of memory for 1 window / 2 tabs monitoring local logs during development.

zachbai commented 1 year ago

Hey all, thanks for the reports. David (@vorporeal) had to divert his attention to a couple other issues but your feedback is heard -- we're actively investigating ways to address this issue.

svenlombaert commented 1 year ago

I have 6 tabs open with about 2 panes each, I just cleared them all with CMD+K but still getting high memory usage

Screenshot 2023-05-31 at 10 40 35
phase commented 1 year ago
image

pls my ram can't take it anymore 😭

It seems to scale with how much text is present in the terminal. Closing & reopening tabs will free a good amount, but it quickly climbs up after continued use.

bitttttten commented 1 year ago

It's not as drastic, although Warp is usually the biggest contender for memory on my laptop too:

Screenshot 2023-07-03 at 14 41 35

If I close all my tabs, about 6 open, it goes down to 150MB.

dannyneira commented 1 year ago

From discord user #rustyballz

Hello, I wonder if others have been having issues with Warp's performance... Pretty much weekly I am getting the following scenario you see in the screenshot. When I try to move the warp window or resize it even the smallest amount it will freeze for long periods of time, sometimes when it freezes it will shrink to this size shown and hide off screen, the only way to bring it back is to show all windows and drag it to a position I can see it. Also shown in this screenshot is the incredibly high RAM usage! My development flow has not changed since switching from iTerm2 and I never had these issues in that app even though I also had unlimited scrollback turned on.

image

RoyzLevy commented 1 year ago

Also here after using Warp for a few months now and liking all of the great features, but still getting big consumption of RAM on my system. Right at the moment I'm getting 2GB of memory for two open tabs which is making it really a hard time keeping using the tool and I'm ending up closing it every now and then during my work day.

ericgross commented 1 year ago

I am also finding it difficult to use Warp because it can't seem to handle a lot of content in the shell, which happens over time.

chav-aniket commented 1 year ago

+1 on this issue, been experiencing some terrible memory drain with warp. CMD+K helped the situation but would be nice for a more efficient app out of the box, love it a little too much to replace it :(

hardskulls commented 1 year ago

Same here. I'm usually looking at 700 MB - 1.7 GB of memory footprint.

DmitryTokyo commented 11 months ago

+1 on this issue. 3 days, 2 tabs, 4 windows. Usage memory is around 3GB. Switched back to iterm2 while this issue will fix

jvsteiner commented 11 months ago

This is an issue for me as well. I usually have about 3-4 tabs open, not too heavy usage, and typically memory consumption ranges from 700MB to 2 Gb. When it's higher, the responsiveness gets laggy as well, as compared to iTerm

Dentrax commented 10 months ago

Same here, Warp uses 7gb+ memory with 7 tabs on my Mac:

Screenshot 2023-11-13 at 22 39 53
dannyneira commented 8 months ago

@garydgregory commented on #2964

When I start warp, it sucks up 833 MB GB of RAM! When I start iTerm 2 it sips 157 MB. Please fix... surely there's a better way.

image
muescha commented 8 months ago

You have warp with existing tabs? The tab history is sometimes long and consume a lot of ram

Dentrax commented 8 months ago

Is there any way to purge the history of current session? (And also set max limit in the settings)

Edit: I'm not sure if Clear Blocks is actual purge. It didn't change memory usage.

svenlombaert commented 8 months ago

Is there any way to purge the history of current session? (And also set max limit in the settings)

Edit: I'm not sure if Clear Blocks is actual purge. It didn't change memory usage.

You can clear the tab with CMD+K, which clears all the blocks. AFAIK there's no option to set scrollback limits.

ernest-ceevo commented 7 months ago

Any update on this ? It is sucking 13GB of ram ... see the attached sample text Sample of CloudflareWARP.txt

rreynier commented 7 months ago

Today my system fully crashed after Warp basically stole all my memory 🤣 I took a screenshot with my phone since the computer was completely unresponsive and required a hard reboot. I had maybe 4 tabs open and 2-3 windows in each?

image

jvsteiner commented 7 months ago

this situation is a joke. I have uninstalled and went back to using iTerm2. When the electron app uses 10-50x less memory than the rust app, you know there is a design flaw.

sullo commented 7 months ago

this situation is a joke. I have uninstalled and went back to using iTerm2. When the electron app uses 10-50x less memory than the rust app, you know there is a design flaw.

Coming up on a year since I opened the issue.

daUnknownCoder commented 7 months ago

i am using the linux version it consumes 8% of my memory, disable some parts of warp toggle? like disable workflows or drive with keybind? ik i m using the AppImage executable so it has to be high but kitty used to be faster, i dont want to switch back to kitty but ig ligatures, 1 line prompt is all tellin my brain to switch but i dont want to pls solve this...

franko-franicevich commented 7 months ago

Same here, over 10GB on Mac cmd-K DID drop it right down, but I like my command history. iterm2 keeps it forever until I close the tab, or clear it intentionally, even between reboots, and does so with low memory footprint. Seems to me you shouldn't need to keep it all in ram.

nevdelap commented 6 months ago

On Linux, after about six hours. 😱 Vanilla bash, just a few aliases and env vars in my .bashrc.

image

I had a terminal tailing a log running for hours, might be related to that. Update: Seems not. I had several terminals open, and 10G virtual memory being used by Warp, and it stayed around while I Ctrl+Shift+K'd in one that was tailing a log, and stayed around until I closed the last one, which was new and had done almost nothing.

nevdelap commented 6 months ago

warp on Linux uses 170MB without doing anything at all, while having 5GB of virtual memory mapped. This example is htop running in xterm, I open a single warp terminal, and don't do anything in it.

image

Of course warp isn't expected to use as little as xterm, but this is the opposite, htop in warp and xterm opened without doing anything.

image

mikelgmh commented 5 months ago

Linux user here. ExtratermQT (Electron based terminal) is using 232mb with 5 terminals open. On the other hand, Warp is using 458mb with 4 terminals open.

Warp is using almost the double of RAM with 1 less terminal instance!

image

Update: As time goes by, seems like Warp is consuming more and more ram with no reason at all. No jobs running at any of the terminal instances.

image

utterstep commented 4 months ago
image

Same here, 2.4Gb used with 10 tabs

jvsteiner commented 4 months ago

This thread is so funny. I long ago uninstalled warp, but stayed subscribed for some/no reason. This is obviously a leak of some kind. I can't imagine that it would be too hard to find with a debugger. Worst case there are several leaks. It's not like it's hard to reproduce. What kind of developer writes code that leaks like this, and then leaves it in for over a year - in a developer tool! It would be funny, that is, if it weren't so sad.

Dentrax commented 4 months ago

This thread is so funny. I long ago uninstalled warp, but stayed subscribed for some/no reason. This is obviously a leak of some kind. I can't imagine that it would be too hard to find with a debugger. Worst case there are several leaks. It's not like it's hard to reproduce. What kind of developer writes code that leaks like this, and then leaves it in for over a year - in a developer tool! It would be funny, that is, if it weren't so sad. - @.jvsteiner

I don't see anything funny here. The funny thing is that to still be able to see those who do not have the "blameless culture".

Every developer can make mistakes and the important thing is to learn from mistakes and then write some regression tests to prevent them from happening again.

You can contribute to project if your codes are "unleakable". I'd be happy to see having this issue resolved.