You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tldr: Project search in directories with big files will cause Zed to crash after consuming all your memory.
Play stupid games, win stupid prizes.
Steps to reproduce:
mkdir /tmp/uspto
cd /tmp/uspto
wget https://bulkdata.uspto.gov/data/patent/grant/redbook/fulltext/2024/ipg241119.zip
unzip ipg241119.zip
rm ipg241119.zip
for i in {1..30}; do cp ipg241119.xml ipg241119-$i.xml; done
azed .
Quit/Save work in any apps you care about, because bad things can happen under memory pressure.
Then: cmd-shift-f and search for <
First time crashed (with 40 files).
Second time succeeded (with 40 files).
Upped the count above to 50 files then I got the OOM prompt, but macOS killed it for me 45 seconds later automagically.
Watch out though, I later ran it with 50 and caused a KP.
I don't think this is a language server thing.
It happens when searching in Plain Text too.
Amazingly Zed beach-balled, ballooned to over 100GB of ram, finished the search, rendered the multi-buffer and dropped to 8GB of ram. When I closed the multi-buffer it dropped to 450MB.
Bravo Zed. Truly stunning.
While this is a bit exaggerated (40GB of XML == 120GB of memory) it's not that crazy for folks to have a directory with data files in a folder that they are also editing in Zed. In practice it means if you project search for the wrong needle with a large datasets lying around you can KP your mac (I did).
mkdir /tmp/uspto-txt
cd /tmp/uspto-txt
wget https://bulkdata.uspto.gov/data/patent/grant/redbook/fulltext/2024/ipg241119.zip
unzip ipg241119.zip
rm ipg241119.zip
for i in {1..50}; do cp ipg241119.xml ipg241119-$i.txt; done
rm ipg241119.xml
zed .
Seriously. Save your work before trying this.
And when macOS suggests you kill Zed, do it.
Failure to so may result in system freezing.
notpeter
changed the title
Search
Excessive memory consumption on project search with large files present
Nov 21, 2024
tldr: Project search in directories with big files will cause Zed to crash after consuming all your memory.
Play stupid games, win stupid prizes.
Steps to reproduce:
Quit/Save work in any apps you care about, because bad things can happen under memory pressure.
Then:
cmd-shift-f
and search for<
First time crashed (with 40 files).
Second time succeeded (with 40 files).
Upped the count above to 50 files then I got the OOM prompt, but macOS killed it for me 45 seconds later automagically.
Watch out though, I later ran it with 50 and caused a KP.
Environment
Zed: v0.163.0 (Zed Nightly 3c57a40)
OS: macOS 14.7.0
Memory: 64 GiB
Architecture: aarch64
Zed.log
Zed.log (round 2)
This time there was a hang in the log (not sure why there wasn't the first time).
The text was updated successfully, but these errors were encountered: