Skip to content
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

Feels like Zed consumes more memory than it used to #25259

Open
ZombieHarvester opened this issue Feb 20, 2025 · 7 comments
Open

Feels like Zed consumes more memory than it used to #25259

ZombieHarvester opened this issue Feb 20, 2025 · 7 comments
Assignees
Labels
performance Feedback for performance issues, speed, memory usage, etc

Comments

@ZombieHarvester
Copy link

ZombieHarvester commented Feb 20, 2025

Summary

Image

Zed takes 1+ gigs of RAM lately for a small Elixir project with 4 tabs open after a few hours. After fresh start it's about 500 mb. So might be a leak

Is it the expected behavior?

Zed Version and System Specs

Zed: v0.174.5 (Zed)
OS: macOS 12.7.6
Memory: 16 GiB
Architecture: x86_64

@beniaminzagan
Copy link
Contributor

Sad to hear this :s But unless we get some actionable information its hard to reproduce the issue. Can we get your settings.json?

@beniaminzagan beniaminzagan added the performance Feedback for performance issues, speed, memory usage, etc label Feb 20, 2025
@SomeoneToIgnore
Copy link
Contributor

Also, seems that you're on macOS, can you debug it more?

  1. Enable hierarchical grouping
Image
  1. Check out the biggest offenders:
Image
  1. Do lsof -p $PID for the generic processes like node or whatever else occupies a lot of memory.
Image

@ZombieHarvester
Copy link
Author

ZombieHarvester commented Feb 20, 2025

I have restarted it a couple hours ago, memory consumption went back to ~450mb
Now it went up again

But unless we get some actionable information

I understand, I'd love to help troubleshoot if you guide me

Image

Only 2 offenders above 1 gb - Zed and WindowServer

lsof -p 95411
COMMAND   PID USER   FD      TYPE             DEVICE  SIZE/OFF                NODE NAME
zed     95411  max  cwd       DIR                1,4       640                   2 /
zed     95411  max  txt       REG                1,4 198062736          8917351454 /Applications/Zed.app/Contents/MacOS/zed
zed     95411  max  txt       REG                1,4     46988          8916668515 /Library/Preferences/Logging/.plist-cache.UO97v935
zed     95411  max  txt       REG                1,4  19750912          8917388180 /private/var/folders/3z/cr46pg1x64dby064g5971brm0000gn/0/com.apple.LaunchServices.dv/com.apple.LaunchServices-3028-v2.csstore
zed     95411  max  txt       REG                1,4    135104          8880798068 /System/Library/Caches/com.apple.IntlDataCache.le.kbdx
zed     95411  max  txt       REG                1,4   1296040 1152921500312349831 /System/Library/Keyboard Layouts/AppleKeyboardLayouts.bundle/Contents/Resources/AppleKeyboardLayouts-L.dat
zed     95411  max  txt       REG                1,4     32768          8893628091 /Users/max/Library/Application Support/Zed/db/0-global/db.sqlite-shm
zed     95411  max  txt       REG                1,4     32768          8836688819 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-shm
zed     95411  max  txt       REG                1,4    237952          8861869138 /private/var/db/timezone/tz/2024a.1.0/icutz/icutz44l.dat
zed     95411  max  txt       REG                1,4    119092          8917389178 /private/var/db/analyticsd/events.allowlist
zed     95411  max  txt       REG                1,4    136152 1152921500312200271 /System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/SystemAppearance.car
zed     95411  max  txt       REG                1,4   7214792 1152921500312200245 /System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/DarkAqua.car
zed     95411  max  txt       REG                1,4     71320 1152921500312200257 /System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/FauxVibrantDark.car
zed     95411  max  txt       REG                1,4   6194600 1152921500312200275 /System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/VibrantDark.car
zed     95411  max  txt       REG                1,4    297536 1152921500312783165 /usr/lib/libobjc-trampolines.dylib
zed     95411  max  txt       REG                1,4      8192          8874624912 /Users/max/.config/zed/prompts/prompts-library-db.0.mdb/lock.mdb
zed     95411  max  txt       REG                1,4    237128 1152921500312200265 /System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/FunctionRowAppearance.car
zed     95411  max  txt       REG                1,4     19328              450562 /private/var/folders/3z/cr46pg1x64dby064g5971brm0000gn/C/com.apple.scriptmanager2.le.cache
zed     95411  max  txt       REG                1,4     69277 1152921500312153005 /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/UnknownFSObjectIcon.icns
zed     95411  max  txt       REG                1,4     32768          8916669451 /private/var/db/mds/messages/501/se_SecurityMessages
zed     95411  max  txt       REG                1,4  41682992          8917351347 /Applications/Zed.app/Contents/Frameworks/WebRTC.framework/Versions/A/WebRTC
zed     95411  max  txt       REG                1,4   7322840 1152921500312200233 /System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/Aqua.car
zed     95411  max  txt       REG                1,4   2177216 1152921500312783145 /usr/lib/dyld
zed     95411  max  txt       REG                1,4  30399984 1152921500312794992 /usr/share/icu/icudt70l.dat
zed     95411  max  txt       REG                1,4     57344          8874624913 /Users/max/.config/zed/prompts/prompts-library-db.0.mdb/data.mdb
zed     95411  max  txt       REG                1,4  75890008 1152921500312151330 /System/Library/CoreServices/CoreGlyphs.bundle/Contents/Resources/Assets.car
zed     95411  max  txt       REG                1,4   5425091 1152921500312252050 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Resources/Extras2.rsrc
zed     95411  max  txt       REG                1,4   8167400 1152921500312229210 /System/Library/Fonts/SFNS.ttf
zed     95411  max  txt       REG                1,4   3384528 1152921500312200239 /System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/Assets.car
zed     95411  max  txt       REG                1,4   5635160 1152921500312200285 /System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources/VibrantLight.car
zed     95411  max  txt       REG                1,4   1302528          8836694513 /private/var/folders/3z/cr46pg1x64dby064g5971brm0000gn/C/dev.zed.Zed/com.apple.metal/16777237_590342/functions.data
zed     95411  max  txt       REG                1,4    204912 1152921500312266618 /System/Library/Frameworks/FileProvider.framework/OverrideBundles/FileProviderOverride.bundle/Contents/MacOS/FileProviderOverride
zed     95411  max  txt       REG                1,4    202800 1152921500312266607 /System/Library/Frameworks/FileProvider.framework/OverrideBundles/CloudDocsFileProvider.bundle/Contents/MacOS/CloudDocsFileProvider
zed     95411  max  txt       REG                1,4      7704          8818197869 /Library/Application Support/CrashReporter/SubmitDiagInfo.domains
zed     95411  max  txt       REG                1,4    526960 1152921500312266632 /System/Library/Frameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride
zed     95411  max  txt       REG                1,4   2369376 1152921500312229150 /System/Library/Fonts/Helvetica.ttc
zed     95411  max  txt       REG                1,4    262172          8881336575 /Library/Caches/com.apple.iconservices.store/A2F7582C-B3EB-3049-A224-674BB6D12DE3.isdata
zed     95411  max  txt       REG                1,4    626688          8906277461 /private/var/folders/3z/cr46pg1x64dby064g5971brm0000gn/C/com.apple.iconservices/store.index
zed     95411  max  txt       REG                1,4   2155812 1152921500312229172 /System/Library/Fonts/Menlo.ttc
zed     95411  max  txt       REG                1,4    684624 1152921500312229317 /System/Library/Fonts/Supplemental/Courier New.ttf
zed     95411  max  txt       REG                1,4   1704268 1152921500312229204 /System/Library/Fonts/SFCompact.ttf
zed     95411  max  txt       REG                1,4     81920          8836694510 /private/var/folders/3z/cr46pg1x64dby064g5971brm0000gn/C/dev.zed.Zed/com.apple.metal/31001/libraries.data
zed     95411  max  txt       REG                1,4    252032             7691112 /Users/max/Library/Fonts/FiraCode-Bold.ttf
zed     95411  max  txt       REG                1,4    220772             7691108 /Users/max/Library/Fonts/FiraCode-Light.ttf
zed     95411  max  txt       REG                1,4    218476             7691109 /Users/max/Library/Fonts/FiraCode-Medium.ttf
zed     95411  max  txt       REG                1,4    220044             7691110 /Users/max/Library/Fonts/FiraCode-Regular.ttf
zed     95411  max  txt       REG                1,4    221184             7691111 /Users/max/Library/Fonts/FiraCode-Retina.ttf
zed     95411  max  txt       REG                1,4   3200332 1152921500312229168 /System/Library/Fonts/LucidaGrande.ttc
zed     95411  max  txt       REG                1,4  77143236 1152921500312229200 /System/Library/Fonts/PingFang.ttc
zed     95411  max    0r      CHR                3,2       0t0                 317 /dev/null
zed     95411  max    1u      CHR                3,2       0t0                 317 /dev/null
zed     95411  max    2u      CHR                3,2     0t133                 317 /dev/null
zed     95411  max    3w      REG                1,4    761618          8917405682 /Users/max/Library/Logs/Zed/Zed.log
zed     95411  max    4u   KQUEUE                                                  count=0, state=0xa
zed     95411  max    5u      REG                1,4      4096          8893628088 /Users/max/Library/Application Support/Zed/db/0-global/db.sqlite
zed     95411  max    6u      REG                1,4     24752          8893628090 /Users/max/Library/Application Support/Zed/db/0-global/db.sqlite-wal
zed     95411  max    7u      REG                1,4     32768          8893628091 /Users/max/Library/Application Support/Zed/db/0-global/db.sqlite-shm
zed     95411  max    8u      REG                1,4      4096          8893628088 /Users/max/Library/Application Support/Zed/db/0-global/db.sqlite
zed     95411  max    9u      REG                1,4     24752          8893628090 /Users/max/Library/Application Support/Zed/db/0-global/db.sqlite-wal
zed     95411  max   10u      REG                1,4  20340736          8836688816 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite
zed     95411  max   11u      REG                1,4  13769072          8836688818 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-wal
zed     95411  max   12u      REG                1,4     32768          8836688819 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-shm
zed     95411  max   13u      REG                1,4  20340736          8836688816 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite
zed     95411  max   14u      REG                1,4  13769072          8836688818 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-wal
zed     95411  max   15u     IPv4 0x88f1e5a7b6b7a5b9       0t0                 TCP localhost:44438 (LISTEN)
zed     95411  max   16r      DIR                1,4       160              419635 /Users
zed     95411  max   18r      DIR                1,4      5856          8836688806 /Users/max/.config/zed
zed     95411  max   19r      REG                1,4    152910 1152921500312258244 /System/Library/Frameworks/CoreImage.framework/Versions/A/Resources/ci_stdlib.metallib
zed     95411  max   20r      DIR                1,4       960 1152921500311879682 /System/Volumes/Data
zed     95411  max   21u   KQUEUE                                                  count=0, state=0x8
zed     95411  max   22u   KQUEUE                                                  count=0, state=0x8
zed     95411  max   23r      REG                1,4       587          8836711685 /Users/max/.config/zed/keymap.json
zed     95411  max   24r      DIR                1,4       352             1684582 /Users/max/.config
zed     95411  max   25r      DIR                1,4      5856          8836688806 /Users/max/.config/zed
zed     95411  max   26r      DIR                1,4      3712              445663 /Users/max
zed     95411  max   27r      DIR                1,4       352             1684582 /Users/max/.config
zed     95411  max   28r      DIR                1,4       160              419635 /Users
zed     95411  max   29r      DIR                1,4      3712              445663 /Users/max
zed     95411  max   30r      DIR                1,4       960 1152921500311879682 /System/Volumes/Data
zed     95411  max   31r      DIR                1,4       448 1152921500312727632 /System/Volumes
zed     95411  max   32r      DIR                1,4       448 1152921500312727632 /System/Volumes
zed     95411  max   33r      DIR                1,4       288 1152921500311879701 /System
zed     95411  max   34r      DIR                1,4       288 1152921500311879701 /System
zed     95411  max   35r      DIR                1,4      5856          8836688806 /Users/max/.config/zed
zed     95411  max   36u   KQUEUE                                                  count=0, state=0xa
zed     95411  max   37u   KQUEUE                                                  count=0, state=0x8
zed     95411  max   38u   KQUEUE                                                  count=0, state=0xa
zed     95411  max   39u   KQUEUE                                                  count=0, state=0x8
zed     95411  max   40u   KQUEUE                                                  count=0, state=0xa
zed     95411  max   41w      REG                1,4     33004          8903478605 /Users/max/Library/Logs/Zed/telemetry.log
zed     95411  max   42u      REG                1,4      8192          8874624912 /Users/max/.config/zed/prompts/prompts-library-db.0.mdb/lock.mdb
zed     95411  max   43u      REG                1,4  20340736          8836688816 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite
zed     95411  max   44u      REG                1,4  13769072          8836688818 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-wal
zed     95411  max   45u      REG                1,4     57344          8874624913 /Users/max/.config/zed/prompts/prompts-library-db.0.mdb/data.mdb
zed     95411  max   46w      REG                1,4     57344          8874624913 /Users/max/.config/zed/prompts/prompts-library-db.0.mdb/data.mdb
zed     95411  max   47u   KQUEUE                                                  count=0, state=0x8
zed     95411  max   48u     unix 0x88f1e5a7b448fa79       0t0                     ->0x88f1e5a7b448fd99
zed     95411  max   49u     unix 0x88f1e5a7b448fd99       0t0                     ->0x88f1e5a7b448fa79
zed     95411  max   50u     unix 0x88f1e5a7b448fd99       0t0                     ->0x88f1e5a7b448fa79
zed     95411  max   51r      DIR                1,4      5856          8836688806 /Users/max/.config/zed
zed     95411  max   52r      DIR                1,4       352             1684582 /Users/max/.config
zed     95411  max   53r      DIR                1,4      3712              445663 /Users/max
zed     95411  max   54r      DIR                1,4       160              419635 /Users
zed     95411  max   55r      DIR                1,4       960 1152921500311879682 /System/Volumes/Data
zed     95411  max   56r      DIR                1,4       448 1152921500312727632 /System/Volumes
zed     95411  max   57r      DIR                1,4       288 1152921500311879701 /System
zed     95411  max   58u   KQUEUE                                                  count=0, state=0x8
zed     95411  max   59u   KQUEUE                                                  count=0, state=0x8
zed     95411  max   60r      DIR                1,4        64          8883028034 /Users/max/.config/zed/prompt_overrides
zed     95411  max   61r      DIR                1,4      5856          8836688806 /Users/max/.config/zed
zed     95411  max   62r      DIR                1,4       352             1684582 /Users/max/.config
zed     95411  max   63r      DIR                1,4      3712              445663 /Users/max
zed     95411  max   64r      DIR                1,4       160              419635 /Users
zed     95411  max   65r      DIR                1,4       960 1152921500311879682 /System/Volumes/Data
zed     95411  max   66r      DIR                1,4       448 1152921500312727632 /System/Volumes
zed     95411  max   67r      DIR                1,4       288 1152921500311879701 /System
zed     95411  max   68u   KQUEUE                                                  count=0, state=0x8
zed     95411  max   69u   KQUEUE                                                  count=0, state=0x8
zed     95411  max   70r      DIR                1,4       480          8861115940 /Users/max/Library/Application Support/Zed/extensions/installed
zed     95411  max   71r      DIR                1,4       192          8861115939 /Users/max/Library/Application Support/Zed/extensions
zed     95411  max   72r      DIR                1,4       320          8836688807 /Users/max/Library/Application Support/Zed
zed     95411  max   73r      DIR                1,4      5600              445683 /Users/max/Library/Application Support
zed     95411  max   74r      DIR                1,4      3968              445668 /Users/max/Library
zed     95411  max   75r      DIR                1,4      3712              445663 /Users/max
zed     95411  max   76r      DIR                1,4       160              419635 /Users
zed     95411  max   77r      DIR                1,4       960 1152921500311879682 /System/Volumes/Data
zed     95411  max   78r      DIR                1,4       448 1152921500312727632 /System/Volumes
zed     95411  max   79r      DIR                1,4       288 1152921500311879701 /System
zed     95411  max   80u   KQUEUE                                                  count=0, state=0x8
zed     95411  max   81   NPOLICY                                                  
zed     95411  max   82u    systm 0x88f1e59e1b058eb9       0t0                     [ctl com.apple.netsrc id 6 unit 35]
zed     95411  max   83u     unix 0x88f1e5a7b4490181       0t0                     ->0x88f1e5a7b4486889
zed     95411  max   85r      REG                1,4    605748 1152921500312258240 /System/Library/Frameworks/CoreImage.framework/Versions/A/Resources/ci_filters.metallib
zed     95411  max   86u      REG                1,4  20340736          8836688816 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite
zed     95411  max   87r      DIR                1,4      5856          8836688806 /Users/max/.config/zed
zed     95411  max   88u   KQUEUE                                                  count=0, state=0x8
zed     95411  max   89u      REG                1,4  13769072          8836688818 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-wal
zed     95411  max   90r      DIR                1,4        64          8860131682 /Users/max/.config/zed/themes
zed     95411  max   91r      DIR                1,4       352             1684582 /Users/max/.config
zed     95411  max   92r      DIR                1,4      3712              445663 /Users/max
zed     95411  max   93r      DIR                1,4       448 1152921500312727632 /System/Volumes
zed     95411  max   94r      DIR                1,4       160              419635 /Users
zed     95411  max   95r      DIR                1,4       960 1152921500311879682 /System/Volumes/Data
zed     95411  max   96u      REG                1,4  20340736          8836688816 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite
zed     95411  max   97r      DIR                1,4       288 1152921500311879701 /System
zed     95411  max   98u   KQUEUE                                                  count=0, state=0x8
zed     95411  max   99u      REG                1,4  13769072          8836688818 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-wal
zed     95411  max  100r      DIR                1,4       160              419635 /Users
zed     95411  max  101u   KQUEUE                                                  count=0, state=0x8
zed     95411  max  102r      REG                1,4   1179816 1152921500312258248 /System/Library/Frameworks/CoreImage.framework/Versions/A/Resources/ci_stdlib_stitchable.metallib
zed     95411  max  103u   KQUEUE                                                  count=0, state=0x8
zed     95411  max  104r      DIR                1,4       448 1152921500312727632 /System/Volumes
zed     95411  max  105r      REG                1,4        99          8836710257 /Users/max/.config/github-copilot/hosts.json
zed     95411  max  106r      DIR                1,4       128          8836710256 /Users/max/.config/github-copilot
zed     95411  max  107u   KQUEUE                                                  count=0, state=0x8
zed     95411  max  108r      DIR                1,4       352             1684582 /Users/max/.config
zed     95411  max  109r      DIR                1,4      3712              445663 /Users/max
zed     95411  max  110r      REG                1,4      1087          8866461685 /Users/max/.config/zed/tasks.json
zed     95411  max  111r      DIR                1,4       160              419635 /Users
zed     95411  max  112r      DIR                1,4       960 1152921500311879682 /System/Volumes/Data
zed     95411  max  113r      DIR                1,4       288 1152921500311879701 /System
zed     95411  max  114r      DIR                1,4      5856          8836688806 /Users/max/.config/zed
zed     95411  max  115r      DIR                1,4       352             1684582 /Users/max/.config
zed     95411  max  116r      DIR                1,4      3712              445663 /Users/max
zed     95411  max  117r      DIR                1,4       448 1152921500312727632 /System/Volumes
zed     95411  max  118r      DIR                1,4       960 1152921500311879682 /System/Volumes/Data
zed     95411  max  119u   KQUEUE                                                  count=0, state=0x8
zed     95411  max  120r      DIR                1,4       288 1152921500311879701 /System
zed     95411  max  121u   KQUEUE                                                  count=0, state=0x8
zed     95411  max  122u   KQUEUE                                                  count=0, state=0x8
zed     95411  max  123r      REG                1,4   3787562 1152921500312258242 /System/Library/Frameworks/CoreImage.framework/Versions/A/Resources/ci_filters_stitchable.metallib
zed     95411  max  124r      DIR                1,4       352             1684582 /Users/max/.config
zed     95411  max  125r      DIR                1,4       832          8915394077 /Users/max/Documents/dev/pdf_translator
zed     95411  max  126r      DIR                1,4      3712              445663 /Users/max
zed     95411  max  127r      DIR                1,4       160              419635 /Users
zed     95411  max  128r      DIR                1,4       960 1152921500311879682 /System/Volumes/Data
zed     95411  max  129r      DIR                1,4       448 1152921500312727632 /System/Volumes
zed     95411  max  130r      DIR                1,4       288 1152921500311879701 /System
zed     95411  max  131u   KQUEUE                                                  count=0, state=0x8
zed     95411  max  132r      DIR                1,4       832          8915394077 /Users/max/Documents/dev/pdf_translator
zed     95411  max  133r      DIR                1,4      5856          8836688806 /Users/max/.config/zed
zed     95411  max  134r      REG                1,4      3440          8917405689 /Users/max/.config/zed/settings.json
zed     95411  max  135r      DIR                1,4       800          8661172245 /Users/max/Documents/dev
zed     95411  max  136r      DIR                1,4      1952              445664 /Users/max/Documents
zed     95411  max  137r      DIR                1,4      3712              445663 /Users/max
zed     95411  max  138r      DIR                1,4       160              419635 /Users
zed     95411  max  139r      DIR                1,4       960 1152921500311879682 /System/Volumes/Data
zed     95411  max  140r      DIR                1,4       448 1152921500312727632 /System/Volumes
zed     95411  max  141r      DIR                1,4       288 1152921500311879701 /System
zed     95411  max  142u   KQUEUE                                                  count=0, state=0x8
zed     95411  max  143r      DIR                1,4       160          8866487816 /Users/max/Library/Application Support/Zed/extensions/work/dockerfile
zed     95411  max  144r      REG                1,4      7704          8818197869 /Library/Application Support/CrashReporter/SubmitDiagInfo.domains
zed     95411  max  145r      DIR                1,4       160          8866487816 /Users/max/Library/Application Support/Zed/extensions/work/dockerfile
zed     95411  max  146u      REG                1,4   1302528          8836694513 /private/var/folders/3z/cr46pg1x64dby064g5971brm0000gn/C/dev.zed.Zed/com.apple.metal/16777237_590342/functions.data
zed     95411  max  147u   KQUEUE                                                  count=0, state=0xa
zed     95411  max  148u   KQUEUE                                                  count=0, state=0xa
zed     95411  max  149u   KQUEUE                                                  count=0, state=0xa
zed     95411  max  150u      REG                1,4      4692          8917405692 /private/var/folders/3z/cr46pg1x64dby064g5971brm0000gn/C/dev.zed.Zed/com.apple.metal/16777237_590342/functions.list
zed     95411  max  151u      REG                1,4  20340736          8836688816 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite
zed     95411  max  152u      REG                1,4  20340736          8836688816 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite
zed     95411  max  153u      REG                1,4  20340736          8836688816 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite
zed     95411  max  154u      REG                1,4  20340736          8836688816 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite
zed     95411  max  155u      REG                1,4  13769072          8836688818 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-wal
zed     95411  max  156u      REG                1,4  13769072          8836688818 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-wal
zed     95411  max  157u      REG                1,4  13769072          8836688818 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-wal
zed     95411  max  158u      REG                1,4  13769072          8836688818 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-wal
zed     95411  max  159u      REG                1,4  20340736          8836688816 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite
zed     95411  max  160u      REG                1,4  13769072          8836688818 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-wal
zed     95411  max  161u      REG                1,4  20340736          8836688816 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite
zed     95411  max  162u      REG                1,4  13769072          8836688818 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-wal
zed     95411  max  163u      REG                1,4  20340736          8836688816 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite
zed     95411  max  164u      REG                1,4  13769072          8836688818 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-wal
zed     95411  max  165u      REG                1,4  20340736          8836688816 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite
zed     95411  max  166u      REG                1,4  13769072          8836688818 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-wal
zed     95411  max  167u   KQUEUE                                                  count=0, state=0xa
zed     95411  max  168r      DIR                1,4       192          8870612909 /Users/max/Library/Application Support/Zed/extensions/work/elixir
zed     95411  max  169u   KQUEUE                                                  count=0, state=0x8
zed     95411  max  170u     unix 0x88f1e5a7b4487e69       0t0                     ->0x88f1e5a7b44880c1
zed     95411  max  171u      CHR               15,0     0t684                 586 /dev/ptmx
zed     95411  max  172r      DIR                1,4       192          8870612909 /Users/max/Library/Application Support/Zed/extensions/work/elixir
zed     95411  max  173u     IPv4 0x88f1e5a7b487b061       0t0                 TCP macbook-pro:59926->104.26.11.80:https (ESTABLISHED)
zed     95411  max  174      PIPE 0xe41b0f64dbfa813d     65536                     ->0x44a383be5feacdc6
zed     95411  max  175r      DIR                1,4        64          8902449534 /Users/max/Library/Application Support/Zed/extensions/work/erlang
zed     95411  max  176u     unix 0x88f1e5a7b44880c1       0t0                     ->0x88f1e5a7b4487e69
zed     95411  max  177r      DIR                1,4        64          8902449534 /Users/max/Library/Application Support/Zed/extensions/work/erlang
zed     95411  max  178r      DIR                1,4       160          8869515265 /Users/max/Library/Application Support/Zed/extensions/work/html
zed     95411  max  179r      DIR                1,4       160          8869515265 /Users/max/Library/Application Support/Zed/extensions/work/html
zed     95411  max  180u   KQUEUE                                                  count=0, state=0x8
zed     95411  max  181u      REG                1,4  20340736          8836688816 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite
zed     95411  max  182r      DIR                1,4        96          8916754220 /Users/max/Library/Application Support/Zed/extensions/work/ruff
zed     95411  max  183r      DIR                1,4        64          8871804711 /Users/max/Library/Application Support/Zed/extensions/work/ruby
zed     95411  max  184r      DIR                1,4        64          8871804711 /Users/max/Library/Application Support/Zed/extensions/work/ruby
zed     95411  max  185u   KQUEUE                                                  count=0, state=0x8
zed     95411  max  186r      DIR                1,4     10496          8838023100 /Users/max/.config/zed/conversations
zed     95411  max  187r      DIR                1,4      5856          8836688806 /Users/max/.config/zed
zed     95411  max  188r      DIR                1,4       352             1684582 /Users/max/.config
zed     95411  max  189r      DIR                1,4      3712              445663 /Users/max
zed     95411  max  190r      DIR                1,4       160              419635 /Users
zed     95411  max  191r      DIR                1,4       960 1152921500311879682 /System/Volumes/Data
zed     95411  max  192r      DIR                1,4       448 1152921500312727632 /System/Volumes
zed     95411  max  193r      DIR                1,4       288 1152921500311879701 /System
zed     95411  max  194r      DIR                1,4        96          8916754220 /Users/max/Library/Application Support/Zed/extensions/work/ruff
zed     95411  max  195r      DIR                1,4       160          8905148121 /Users/max/Library/Application Support/Zed/extensions/work/scss
zed     95411  max  196r      DIR                1,4       160          8905148121 /Users/max/Library/Application Support/Zed/extensions/work/scss
zed     95411  max  197r      DIR                1,4        96          8877210295 /Users/max/Library/Application Support/Zed/extensions/work/snippets
zed     95411  max  198r      DIR                1,4        96          8877210295 /Users/max/Library/Application Support/Zed/extensions/work/snippets
zed     95411  max  199r      DIR                1,4        96          8881876525 /Users/max/Library/Application Support/Zed/extensions/work/toml
zed     95411  max  200r      DIR                1,4        96          8881876525 /Users/max/Library/Application Support/Zed/extensions/work/toml
zed     95411  max  201      PIPE 0x25a69c7b89a2e5c4     16384                     ->0x27b7131dbcb795b4
zed     95411  max  202      PIPE 0x64f222c5b18bf79b     65536                     ->0x25248ba288ef4932
zed     95411  max  203      PIPE 0x30b4c10da0eb4986     16384                     ->0x80e0acfcd9d97e4f
zed     95411  max  204      PIPE 0x28d8f0aaed2dd86e     65536                     ->0x2b99caf16991f927
zed     95411  max  205      PIPE 0x618ba34b7f328868     65536                     ->0x572ad32c89184f7e
zed     95411  max  206      PIPE   0x12055e2e756804     16384                     ->0xe611a8fb19d619f9
zed     95411  max  207      PIPE 0x3063acf9adb28fc8     16384                     ->0x5a3badcf3a36c510
zed     95411  max  208      PIPE 0x250990019818a8d4     16384                     ->0xe480125d6956c6ec
zed     95411  max  209      PIPE 0x7171a3eedb4ebae6     16384                     ->0xb38ed997875937db
zed     95411  max  210r      DIR                1,4       832          8915394077 /Users/max/Documents/dev/pdf_translator
zed     95411  max  211      PIPE 0xe09f702401efeef9     16384                     ->0xc9737e17c4c12d23
zed     95411  max  212      PIPE 0xa7af1fedf7fffe88     16384                     ->0x921d58fe1e5b13c9
zed     95411  max  213r      DIR                1,4       800          8661172245 /Users/max/Documents/dev
zed     95411  max  214r      DIR                1,4      1952              445664 /Users/max/Documents
zed     95411  max  215r      DIR                1,4      3712              445663 /Users/max
zed     95411  max  216r      DIR                1,4       160              419635 /Users
zed     95411  max  217r      DIR                1,4       960 1152921500311879682 /System/Volumes/Data
zed     95411  max  218r      DIR                1,4       448 1152921500312727632 /System/Volumes
zed     95411  max  219r      DIR                1,4       288 1152921500311879701 /System
zed     95411  max  220u   KQUEUE                                                  count=0, state=0x8
zed     95411  max  221u   KQUEUE                                                  count=0, state=0x8
zed     95411  max  222r      DIR                1,4       832          8915394077 /Users/max/Documents/dev/pdf_translator
zed     95411  max  223r      DIR                1,4       800          8661172245 /Users/max/Documents/dev
zed     95411  max  224r      DIR                1,4      1952              445664 /Users/max/Documents
zed     95411  max  225r      DIR                1,4      3712              445663 /Users/max
zed     95411  max  226r      DIR                1,4       160              419635 /Users
zed     95411  max  227r      DIR                1,4       960 1152921500311879682 /System/Volumes/Data
zed     95411  max  228r      DIR                1,4       448 1152921500312727632 /System/Volumes
zed     95411  max  229r      DIR                1,4       288 1152921500311879701 /System
zed     95411  max  230u   KQUEUE                                                  count=0, state=0x8
zed     95411  max  231u      REG                1,4     24096          8917405900 /Users/max/Library/Saved Application State/dev.zed.Zed.savedState/data.data
zed     95411  max  232w      REG                1,4      4998          8917405901 /Users/max/Library/Saved Application State/dev.zed.Zed.savedState/windows.plist
zed     95411  max  233u      REG                1,4      9952          8917405902 /Users/max/Library/Saved Application State/dev.zed.Zed.savedState/window_1.data
zed     95411  max  234u      REG                1,4     81920          8836694510 /private/var/folders/3z/cr46pg1x64dby064g5971brm0000gn/C/dev.zed.Zed/com.apple.metal/31001/libraries.data
zed     95411  max  235u      REG                1,4       548          8917407177 /private/var/folders/3z/cr46pg1x64dby064g5971brm0000gn/C/dev.zed.Zed/com.apple.metal/31001/libraries.list
zed     95411  max  236u      REG                1,4  13769072          8836688818 /Users/max/Library/Application Support/Zed/db/0-stable/db.sqlite-wal
zed     95411  max  237r      REG                1,4    144580 1152921500312252130 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Resources/HIToolbox.rsrc
zed     95411  max  238r      REG                1,4    490410 1152921500312252029 /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Resources/English.lproj/Localized.rsrc

settings.json

// Zed settings
//
// For information on how to configure Zed, see the Zed
// documentation: https://zed.dev/docs/configuring-zed
//
// To see all of Zed's default settings without changing your
// custom settings, run the `open default settings` command
// from the command palette or from `Zed` application menu.
{
  "assistant": {
    "dock": "right",
    "default_model": {
      "provider": "copilot_chat",
      "model": "o3-mini"
    },
    "version": "2",
    "provider": {
      "name": "openai",
      "default_model": "gpt-4o-mini",
      "available_models": []
    }
  },
  "features": {
    // Which edit prediction provider to use.
    "edit_prediction_provider": "zed"
  },
  "terminal": {
    "dock": "right"
  },
  "project_panel": {
    "dock": "right"
  },
  "telemetry": {
    "metrics": true
  },
  "theme": "Ayu Dark",
  "base_keymap": "SublimeText",
  "buffer_font_size": 16.0,
  "tab_size": 2,
  "format_on_save": "off",
  // "buffer_font_family": "JetBrains Mono",
  "buffer_font_family": "Fira Code",
  // "buffer_font_family": "Monaspace Neon",
  // The OpenType features to enable for text in the editor.
  "buffer_font_features": {
    // Disable ligatures:
    // "calt": false
  },
  "languages": {
    "Ruby": {
      "tab_size": 2,
      "language_servers": [
        "ruby-lsp",
        "!rubocop",
        "tailwindcss-language-server",
        "!solargraph",
      ],
      "formatter": "language_server",
      "format_on_save": "on",
    }
  },
  "lsp": {
    // https://zed.dev/docs/languages/ruby#language-servers
    "ruby-lsp": {
      // https://zed.dev/docs/languages/ruby#setting-up-ruby-lsp
      // https://github.com/zed-industries/zed/discussions/6560
      "initialization_options": {
        "experimentalFeaturesEnabled": true,
        "formatter": "standard",
        "linters": ["standard"],
        "enabledFeatures": {
          "codeActions": true,
          "codeLens": true,
          "completion": true,
          "definition": true,
          "diagnostics": false, // until Zed supports pull-type diagnostics
          "documentHighlights": true,
          "documentLink": true,
          "documentSymbols": true,
          "foldingRanges": true,
          "formatting": true,
          "hover": true,
          "inlayHint": true,
          "onTypeFormatting": true,
          "selectionRanges": true,
          "semanticHighlighting": true,
          "signatureHelp": true,
          "typeHierarchy": true,
          "workspaceSymbol": true
        },
        "featuresConfiguration": {
          "inlayHint": {
            "implicitHashValue": true,
            "implicitRescue": true
          }
        }
      }
    },
    "rubocop": {
      // https://zed.dev/docs/languages/ruby#setting-up-rubocop-lsp
      "initialization_options": {
        "safeAutocorrect": false
      }
    },
    "solargraph": {
      // https://zed.dev/docs/languages/ruby#setting-up-solargraph
      "initialization_options": {
        "diagnostics": true,
        "formatting": true
      }
    },
    // "tailwindcss-language-server": {
    //   // https://zed.dev/docs/languages/ruby#using-the-tailwind-css-language-server-with-ruby
    //   "settings": {
    //     "includeLanguages": {
    //       "erb": "html",
    //       "ruby": "html"
    //     },
    //     "experimental": {
    //       "classRegex": ["\\bclass:\\s*['\"]([^'\"]*)['\"]"]
    //     }
    //   }
    // },
  }
}

@ZombieHarvester
Copy link
Author

I also recently reported Ruby LSP memory leak #24900 they might be connected, might be a coincidence

@SomeoneToIgnore
Copy link
Contributor

Thank you for the info, sad, but this is Zed or its plugins indeed it seems.

I do not see anything instantly suspicious (some files are opened multiple times, such as DB which is odd..)

But indeed, Ruby and Toml (#13190) extensions seem to leak memory — seems that both are used in the project?

If you can share the project, it would be great so someone in the team can try it more.
If not, I can see no other way but to open Instruments/Valgrind/etc. and run it on a non-release Zed instance (as the *.dmg one disallows memory profiling in macOS it seems).

@maxbrunsfeld
Copy link
Collaborator

@ZombieHarvester Thanks for following up with more info.

Do you ever see this high usage on an open-source ruby project? If so, that would give us a way to try and reproduce.

@ZombieHarvester
Copy link
Author

ZombieHarvester commented Feb 21, 2025

I haven't worked on open source, sorry don't have any code to share. I'll keep observing.

What is the normal memory usage for Zed?

Today I removed the Toml extension and didn't use the built-in console, only two tabs of Elixir code and the assistant pane. Memory usage slowly went up to 900 MB and dropped down to 350 MB immediately after I closed the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Feedback for performance issues, speed, memory usage, etc
Projects
None yet
Development

No branches or pull requests

6 participants