Skip to content

Periodically log memory usage - #58999

Merged
Anthony-Eid merged 1 commit into
mainfrom
memory-logs
Jun 17, 2026
Merged

Periodically log memory usage#58999
Anthony-Eid merged 1 commit into
mainfrom
memory-logs

Conversation

@Anthony-Eid

@Anthony-Eid Anthony-Eid commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

In recent memory leak reports the log was lost (OS killed Zed or forced a reboot) or showed nothing about when memory grew, leaving us unable to correlate growth with LSP/toolchain activity in the log. This should help diagnose:

The polling costs one single-PID, memory-only sysinfo refresh (roughly one syscall) every 30s — less than the existing per-language-server polling in lsp_button.rs. So the overhead of this shouldn't affect performance of Zed.

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content adheres to Zed's UI standards (UX/UI and icon guidelines)
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • N/A

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jun 10, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Jun 10, 2026
@Anthony-Eid Anthony-Eid changed the title Add memory usage logging Periodically log memory usage Jun 10, 2026
@Anthony-Eid
Anthony-Eid added this pull request to the merge queue Jun 17, 2026
Merged via the queue into main with commit 39ea287 Jun 17, 2026
46 checks passed
@Anthony-Eid
Anthony-Eid deleted the memory-logs branch June 17, 2026 17:22
This was referenced Jun 18, 2026
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
In recent memory leak reports the log was lost (OS killed Zed or forced
a reboot) or showed nothing about when memory grew, leaving us unable to
correlate growth with LSP/toolchain activity in the log. This should
help diagnose:

- zed-industries#58987
- zed-industries#58662
- zed-industries#31461

The polling costs one single-PID, memory-only sysinfo refresh (roughly
one syscall) every 30s — less than the existing per-language-server
polling in `lsp_button.rs`. So the overhead of this shouldn't affect
performance of Zed.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants