# Periodically log memory usage \(\#58999\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/39ea28735d1a3a4a7a171c62537d951ee82b7c39)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 39ea28735d1a3a4a7a171c62537d951ee82b7c39

Requested commit: 39ea28735d1a3a4a7a171c62537d951ee82b7c39

Commit: 39ea28735d1a3a4a7a171c62537d951ee82b7c39

Tree: 1f56d1c09074852f9044d7708d83a5274717c94c

Author: Anthony Eid

Committer: GitHub

## Message

```
Periodically log memory usage (#58999)

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:

- https://github.com/zed-industries/zed/issues/58987
- https://github.com/zed-industries/zed/issues/58662
- https://github.com/zed-industries/zed/issues/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
```

## Parents

- [555ed0495f81a5b631792cba059a4e0d31bb1329](https://git.cafe/gitcafe/zed/commit/555ed0495f81a5b631792cba059a4e0d31bb1329?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/39ea28735d1a3a4a7a171c62537d951ee82b7c39?format=markdown)
