zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
34.48k stars 1.71k forks source link

It crashed when making large amount of replace using cmd + F #11464

Open ramyak-mehra opened 1 week ago

ramyak-mehra commented 1 week ago

Check for existing issues

Describe the bug / provide steps to reproduce it

This is a rather specific scenario but i was editing a log file trying to clean it up and there. I selected the lines with regex(not sure if that does make a difference, just in case). I replaced all occurances with a blank line. It hanged for a bit but eventually did the job. I did see the memory spike but the memory usage never came down. I did a couple of similar edits. The edits are in the order of 10s of thousands each time. The final edit crashed the editor. It was close to 200k edits(I know this is a lot ). The last memory usage was close to 6GB. There were other files opened a rust analyzer running.

Environment

Zed: v0.133.7 (Zed) OS: macOS 14.3.0 Memory: 18 GiB Architecture: aarch64

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

I don't see any logs for the previous sessions

notpeter commented 1 week ago

I'm experiencing the same thing, no crash, but hangs for a while.

Here's a simple steps to reproduce:

  1. Use this 6000 line text file
  2. Find and Replace (cmd+opt+r) with Regex
  3. Find: (.+)\t(.+)
  4. Replace: $2="$1"

Hangs for ~2mins20secs on my machine (Zed v0.133.7, MacOS 13.6.6, Intel, 64GB Memory) before completing successfully.