diff --git a/.agents/notes/implemented/bug-fix/2026-11-17-memory-usage-minimum-window.md b/.agents/notes/implemented/bug-fix/2026-11-17-memory-usage-minimum-window.md new file mode 100644 index 0000000000..af74b89cef --- /dev/null +++ b/.agents/notes/implemented/bug-fix/2026-11-17-memory-usage-minimum-window.md @@ -0,0 +1,52 @@ +# Agent 笔记:内存详情的 CPU/GPU 占用至少按 1 秒计算 + +状态:已实现 + +## 先说结论 + +状态栏内存详情的 CPU 和 GPU 占用率,是两次读取进程表之间累计时间的差除以间隔。以前只要间隔大于 0 就计算,刚打开详情时两次读取只差几十毫秒,主进程 CPU 会显示到 160% 以上,几秒后才恢复。现在由 Core 的 `processMemory.summarize` 保证:相隔不足 1 秒的两张表不做比较。宿主照常把上次返回的基线原样发回,不需要自己判断间隔。 + +## 问题 + +打开详情时,工作台立即读一次进程表(读数 A)。插件名称在后台读完后,会再清空采样时间,紧接着读第二次(读数 B)。A 和 B 只差几十毫秒,这段时间里主要是面板打开和读取本身的开销(每次读取约 3 ms 单核 CPU)。Core 用 B 减 A 的累计时间除以几十毫秒,得出的就是瞬时峰值,而不是持续占用。GPU 也一样:打开详情后才开始读取 GPU,第二次读取就出现约 28% 的瞬时值。 + +## 决策 + +规则放在 Core,因为两个平台的宿主共用同一份计算: + +- 常量 `MIN_USAGE_WINDOW` 为 1,000,000 微秒。 +- 读数距上一个基线至少 1 秒:按基线计算,并开始新基线;新基线把上一个基线的计数(`sampledAt` 和 `processes`)带在 `earlier` 字段里。 +- 读数距基线不足 1 秒:改用基线的 `earlier` 计算,`earlier` 也必须早于读数至少 1 秒,否则不给占用率;返回的基线原样不变,下一次读数仍和同一组计数比较。 +- 读数早于基线(时钟回退):不给占用率,重新开始一个不带 `earlier` 的基线。 + +宿主(`desktop/internal/core/process_memory.go`)的 `MemoryBaseline` 增加 `Earlier` 字段,只负责原样传回;工作台的采样节奏和名称读取不变。 + +正确做法:宿主把 `summary.Baseline` 原样作为下一次的 `Previous`。 + +不要这样做:宿主自己比较两次读取的时间、丢弃间隔短的读数,或把多次结果合并。这样两个平台会各写一份规则,以后容易不一致。 + +## 考虑过的备选方案 + +- 只在工作台里去掉名称读完后的那次重读。可以避开这一次峰值,但任何让两次读取靠得很近的新路径(例如以后加的手动刷新)都会再次出问题,规则也没有落到 Core。 +- 间隔不足 1 秒时只返回空占用率,不带 `earlier`。实现更简单,但面板里的 CPU/GPU 列会在打开时消失再出现,界面闪动。 +- 宿主保存上一次的有效结果,读数过近时继续显示旧值。需要宿主合并数据,不同平台各写一份,违背通用逻辑进 Core 的规则。 + +## 后果 + +- 打开详情时 CPU 不再出现瞬时高值;关闭状态下每 10 秒一次的读数留下的基线,让打开那一刻的 CPU 直接按至少 1 秒的窗口计算。 +- GPU 只在详情打开时读取,所以要等打开后至少 1 秒的下一次采样才有数值,比以前晚一点出现。 +- 基线多带一组计数,请求和响应的体积大约翻倍;进程数量在几十到几百之间,影响可以忽略。 +- `earlier` 是可选字段,契约 fixture 的 `schemaVersion` 保持 1。 + +## 验证 + +- `cargo test -p lithe-process --lib memory::`:在 Lithe-core-rust 的 `rust/` 下运行,回归测试 `a_table_read_too_soon_after_the_baseline_keeps_it_and_has_no_percentages` 在修复前得到 100%,修复后通过;共享 fixture 的新增用例覆盖按 `earlier` 计算和没有 `earlier` 两种情况。 +- `./scripts/desktop/desktop-go.sh test ./internal/core -run TestProcessMemorySummarizeFollowsTheContractFixture`:宿主经链接的 Core 回放共享 fixture,请求里的 `earlier` 能原样编码。 +- `./scripts/desktop/desktop-go.sh test ./internal/workbench -run TestMemoryDetailsShowTheSummaryOfTheWholeInstance`:工作台把返回的基线原样发回。 + +## 适用范围 + +- Lithe-core-rust 的 `rust/crates/process/src/memory.rs`、`rust/contracts/rust-core-api.md`、`rust/fixtures/process-lifecycle/memory-summary-v1.json` +- `desktop/internal/core/process_memory.go` +- `desktop/internal/workbench/memory_monitor.go` +- `shared/platform-feature-matrix/features/memory-monitor.json` diff --git a/desktop/internal/core/process_memory.go b/desktop/internal/core/process_memory.go index 27f6c3aa69..303c1dd473 100644 --- a/desktop/internal/core/process_memory.go +++ b/desktop/internal/core/process_memory.go @@ -71,10 +71,20 @@ type MemoryRequest struct { } // MemoryBaseline holds the use counters of the instance's processes at one moment, which the -// next request sends back so Core can measure the use in between. +// next request sends back as it came so Core can measure the use in between. type MemoryBaseline struct { SampledAt uint64 `json:"sampledAt"` Processes []BaselineProcess `json:"processes"` + // Earlier holds the counters the baseline's own percentages were measured from. Core + // measures a table read less than a second after the baseline from them instead, and + // returns the baseline unchanged. + Earlier *MemoryCounters `json:"earlier,omitempty"` +} + +// MemoryCounters holds the use counters of an earlier table, kept in a baseline. +type MemoryCounters struct { + SampledAt uint64 `json:"sampledAt"` + Processes []BaselineProcess `json:"processes"` } // BaselineProcess is the use counters of one process in a baseline. @@ -104,10 +114,11 @@ type MemoryUsage struct { CompressedBytes *uint64 `json:"compressedBytes,omitempty"` // GPUMemoryBytes is graphics memory the bytes in memory do not hold. GPUMemoryBytes *uint64 `json:"gpuMemoryBytes,omitempty"` - // CPUPercent is the processor use since the previous table, rounded to a tenth. + // CPUPercent is the processor use since counters at least a second older than the table, + // rounded to a tenth. CPUPercent *float64 `json:"cpuPercent,omitempty"` - // GPUPercent is the use of the busiest graphics engine since the previous table, rounded to - // a tenth and at most 100. + // GPUPercent is the use of the busiest graphics engine since counters at least a second + // older than the table, rounded to a tenth and at most 100. GPUPercent *float64 `json:"gpuPercent,omitempty"` } diff --git a/desktop/internal/i18n/shared.generated.go b/desktop/internal/i18n/shared.generated.go index 4f6f4c005f..d0a488c8d9 100644 --- a/desktop/internal/i18n/shared.generated.go +++ b/desktop/internal/i18n/shared.generated.go @@ -1026,7 +1026,7 @@ var sharedCatalogs = map[string]map[string]string{ "desktop.memory.columnInMemory": "In memory", "desktop.memory.gigabytes": "{value} GB", "desktop.memory.help": "Counts the Lithe main process and every process that belongs to it: language servers, plugin services, child processes such as terminals and runs, and the helpers the system starts for Lithe, such as the WebKit processes that show web pages and previews.", - "desktop.memory.helpFigures": "“In memory” is the physical memory the processes hold now; the status bar and the total count only this. “Swapped out” is what the system compressed or wrote to disk for them, which “In memory” does not include. CPU and GPU are the use between two readings, GPU being the busiest graphics engine; the GPU is read only while the details are open, so its use shows from the second reading on.", + "desktop.memory.helpFigures": "“In memory” is the physical memory the processes hold now; the status bar and the total count only this. “Swapped out” is what the system compressed or wrote to disk for them, which “In memory” does not include. CPU and GPU are the use between two readings at least a second apart, GPU being the busiest graphics engine; the GPU is read only while the details are open, so its use shows a moment after they open.", "desktop.memory.helpLinux": "“In memory” is the resident memory less its shared pages; “Swapped out” is what was moved to swap, zram included. CPU counts one fully busy core as 100%, as top does; GPU comes from the engine times the DRM driver reports.", "desktop.memory.helpMacOS": "“In memory” and “Swapped out” add up to what the Memory column of Activity Monitor shows; “Swapped out” is its compressed part. CPU counts one fully busy core as 100%, as Activity Monitor does.", "desktop.memory.helpWindows": "“In memory” is the private working set, which the Memory column of Task Manager shows. Windows does not report how much of a process it compressed, so “Swapped out” is the private commit outside the working set: memory compressed, written to the page file or not yet touched, an upper bound. “GPU memory” is what the Dedicated GPU memory column of Task Manager shows. CPU counts all logical processors fully busy as 100%, as Task Manager does.", @@ -3828,7 +3828,7 @@ var sharedCatalogs = map[string]map[string]string{ "desktop.memory.columnInMemory": "内存中", "desktop.memory.gigabytes": "{value} GB", "desktop.memory.help": "统计 Lithe 主进程和属于它的全部进程:语言服务器、插件服务、终端和运行任务等子进程,以及系统代 Lithe 启动的辅助进程,例如显示网页和预览的 WebKit 进程。", - "desktop.memory.helpFigures": "“内存中”是进程现在占用的物理内存,状态栏和总计都只算这一项。“压缩/换出”是系统为这些进程压缩或写到磁盘上的内存,不计入“内存中”。CPU 和 GPU 是相邻两次读取之间的占用率,GPU 取最忙的那个图形引擎;面板打开后才读取 GPU,第二次读取起才有 GPU 占用。", + "desktop.memory.helpFigures": "“内存中”是进程现在占用的物理内存,状态栏和总计都只算这一项。“压缩/换出”是系统为这些进程压缩或写到磁盘上的内存,不计入“内存中”。CPU 和 GPU 是相隔至少 1 秒的两次读取之间的占用率,GPU 取最忙的那个图形引擎;面板打开后才读取 GPU,所以 GPU 占用要稍等片刻才显示。", "desktop.memory.helpLinux": "“内存中”是常驻内存减去共享页,“压缩/换出”是换出到交换区(包括 zram)的部分。CPU 以一个核心占满为 100%,与 top 一致;GPU 来自 DRM 驱动报告的引擎时间。", "desktop.memory.helpMacOS": "“内存中”加“压缩/换出”就是活动监视器“内存”一列的值,“压缩/换出”是其中被压缩的部分。CPU 以一个核心占满为 100%,与活动监视器一致。", "desktop.memory.helpWindows": "“内存中”是专用工作集,即任务管理器“内存”一列的值。Windows 不单独报告进程被压缩了多少,“压缩/换出”是已提交的专用内存中不在工作集里的部分:被压缩、写入页面文件或尚未用到的内存,所以它是上限。“显存”是任务管理器“专用 GPU 内存”一列的值。CPU 以全部逻辑处理器占满为 100%,与任务管理器一致。", diff --git a/desktop/internal/workbench/memory_details_visual_test.go b/desktop/internal/workbench/memory_details_visual_test.go index c7c0e6371e..27b8033475 100644 --- a/desktop/internal/workbench/memory_details_visual_test.go +++ b/desktop/internal/workbench/memory_details_visual_test.go @@ -62,7 +62,32 @@ func TestVisualMemoryDetails(t *testing.T) { if err := session.Screenshot(filepath.Join(out, scene.id+"-"+look.theme+".png")); err != nil { t.Fatal(err) } + if scene.id != "memory-details" { + return + } + restOnMemoryHelp(h) + if err := session.Screenshot(filepath.Join(out, "memory-details-help-"+look.theme+".png")); err != nil { + t.Fatal(err) + } }) } } } + +// restOnMemoryHelp rests the pointer on the details' ⓘ, the control whose tip is the help, and +// waits for the tip to show. +func restOnMemoryHelp(h *harness) { + h.t.Helper() + help := memoryHelp(h.app.language()) + for _, hit := range h.driver.Snapshot().Hits { + if hit.Hint == help && !hit.IsLabel { + at := center(hit.Bounds) + if err := h.driver.Move(at.X, at.Y); err != nil { + h.t.Fatal(err) + } + h.await("the help of the memory details", func() bool { return len(h.tooltips()) > 0 }) + return + } + } + h.t.Fatal("the memory details have no ⓘ with the help") +} diff --git a/docs/assets/memory-details/README.md b/docs/assets/memory-details/README.md index 996e1aeb63..1f6513758b 100644 --- a/docs/assets/memory-details/README.md +++ b/docs/assets/memory-details/README.md @@ -8,6 +8,7 @@ Quill Tools 语言服务器和系统辅助进程),不代表真实进程的 | --- | --- | --- | | 实例启动了语言服务器、系统辅助进程和其他子进程:顶部是总量(只算“内存中”)和 ⓘ 说明,下一行是整个实例的压缩/换出、显存、CPU 和 GPU;然后是按类别堆叠的条、各类别图例(多个进程时显示进程数),以及占用最多的进程和其余项的合计。图例和进程列表右侧依次是 CPU、GPU、内存中、压缩/换出四列,列标题与数值右对齐 | [截图](memory-details-dark.png) | [截图](memory-details-light.png) | | 只有 Lithe 主进程,且读数不含压缩、CPU、GPU 等数据:只显示主进程一类和“内存中”一列,没有数据的列和统计行不显示,进程列表给出说明,不列 0 MB 的类别 | [截图](memory-details-host-only-dark.png) | [截图](memory-details-host-only-light.png) | +| 鼠标停在标题旁的 ⓘ 上:说明统计范围、“内存中”和“压缩/换出”的含义,CPU 和 GPU 是相隔至少 1 秒的两次读取之间的占用率,最后一段是 macOS 对照活动监视器的说明(无头测试在 macOS 上运行) | [截图](memory-details-help-dark.png) | [截图](memory-details-help-light.png) | 复验:设置 `LITHE_VISUAL_OUTPUT_DIR`,通过 `scripts/desktop/desktop-go.sh test -tags vivahead,lithevisual ./internal/workbench -run '^TestVisualMemoryDetails$' diff --git a/docs/assets/memory-details/memory-details-help-dark.png b/docs/assets/memory-details/memory-details-help-dark.png new file mode 100644 index 0000000000..7e52be2ab6 Binary files /dev/null and b/docs/assets/memory-details/memory-details-help-dark.png differ diff --git a/docs/assets/memory-details/memory-details-help-light.png b/docs/assets/memory-details/memory-details-help-light.png new file mode 100644 index 0000000000..e17025d9b0 Binary files /dev/null and b/docs/assets/memory-details/memory-details-help-light.png differ diff --git a/scripts/desktop/build-desktop-core.sh b/scripts/desktop/build-desktop-core.sh index 30457f086f..dae9936367 100755 --- a/scripts/desktop/build-desktop-core.sh +++ b/scripts/desktop/build-desktop-core.sh @@ -27,13 +27,19 @@ native_path() { fi } -# Lithe-core-rust #80 at 81a6ecf, the branch of the draft on top of main 788e61e (#79, #78): +# Lithe-core-rust fix/process-memory-min-interval at 8dd6c70, the branch of the draft on top of +# main 5202d3b: processMemory.summarize never compares two tables less than a second apart, so +# the memory details no longer show the burst of their own opening as CPU and GPU use; a table +# read sooner is measured from the counters the baseline was itself measured from, which the +# baseline now carries as earlier, and the baseline comes back unchanged. The pin moves to the +# squash merge once the draft is in main. +# Lithe-core-rust main at 5202d3b, #80 squash-merged (the same tree as its branch at 81a6ecf, on +# top of 788e61e, #79 and #78): # lsp.references.query lays out the References tool window (usages grouped in natural file # order, the rows visible under the folds the desktop sends, the usage each row previews and the # usages before and after it, a selection behind a closed node moved to that node); # lsp.references.lines cuts each usage's line by the rule search results use, and -# workspace.search answers previewRanges with that preview (#2096). The pin moves to the squash -# merge once #80 is in main. +# workspace.search answers previewRanges with that preview (#2096). # Lithe-core-rust main at 6a29169, #70 squash-merged on top of c928514 (#73): # editor.copyReferenceLocation formats the innermost document symbol a language server reports # around the caret, with a one-based line, and falls back to the file path when none contains it; @@ -185,7 +191,7 @@ PINNED_CORE_REPOSITORY="https://github.com/Lithe-IDEA/Lithe-core-rust.git" # the contract, plugin guides, reference and SDKs live only in shared/plugins; on top of #16 (reported Git queries folded in the console), # #15 (git.write cherryPick, revert and reset fields), #14 (word-level changed ranges of diff # rows), #13, #8, #7, #6 and #4. -PINNED_CORE_REVISION="81a6ecf947ccde35d4abc9a56111acce892470ed" +PINNED_CORE_REVISION="8dd6c70c87ce948f606d579957478bf19e8979b0" PROFILE="debug" while [[ $# -gt 0 ]]; do case "$1" in diff --git a/shared/i18n/locales/en-US.json b/shared/i18n/locales/en-US.json index b628e06960..ffa4e3293b 100644 --- a/shared/i18n/locales/en-US.json +++ b/shared/i18n/locales/en-US.json @@ -11166,7 +11166,7 @@ "desktop.memory.helpMacOS": "“In memory” and “Swapped out” add up to what the Memory column of Activity Monitor shows; “Swapped out” is its compressed part. CPU counts one fully busy core as 100%, as Activity Monitor does.", "desktop.memory.helpWindows": "“In memory” is the private working set, which the Memory column of Task Manager shows. Windows does not report how much of a process it compressed, so “Swapped out” is the private commit outside the working set: memory compressed, written to the page file or not yet touched, an upper bound. “GPU memory” is what the Dedicated GPU memory column of Task Manager shows. CPU counts all logical processors fully busy as 100%, as Task Manager does.", "desktop.memory.helpLinux": "“In memory” is the resident memory less its shared pages; “Swapped out” is what was moved to swap, zram included. CPU counts one fully busy core as 100%, as top does; GPU comes from the engine times the DRM driver reports.", - "desktop.memory.helpFigures": "“In memory” is the physical memory the processes hold now; the status bar and the total count only this. “Swapped out” is what the system compressed or wrote to disk for them, which “In memory” does not include. CPU and GPU are the use between two readings, GPU being the busiest graphics engine; the GPU is read only while the details are open, so its use shows from the second reading on.", + "desktop.memory.helpFigures": "“In memory” is the physical memory the processes hold now; the status bar and the total count only this. “Swapped out” is what the system compressed or wrote to disk for them, which “In memory” does not include. CPU and GPU are the use between two readings at least a second apart, GPU being the busiest graphics engine; the GPU is read only while the details are open, so its use shows a moment after they open.", "desktop.memory.percent": "{value}%", "desktop.memory.columnCPU": "CPU", "desktop.memory.columnGPU": "GPU", diff --git a/shared/i18n/locales/zh-CN.json b/shared/i18n/locales/zh-CN.json index 1d1af58846..1faed6aa27 100644 --- a/shared/i18n/locales/zh-CN.json +++ b/shared/i18n/locales/zh-CN.json @@ -11166,7 +11166,7 @@ "desktop.memory.helpMacOS": "“内存中”加“压缩/换出”就是活动监视器“内存”一列的值,“压缩/换出”是其中被压缩的部分。CPU 以一个核心占满为 100%,与活动监视器一致。", "desktop.memory.helpWindows": "“内存中”是专用工作集,即任务管理器“内存”一列的值。Windows 不单独报告进程被压缩了多少,“压缩/换出”是已提交的专用内存中不在工作集里的部分:被压缩、写入页面文件或尚未用到的内存,所以它是上限。“显存”是任务管理器“专用 GPU 内存”一列的值。CPU 以全部逻辑处理器占满为 100%,与任务管理器一致。", "desktop.memory.helpLinux": "“内存中”是常驻内存减去共享页,“压缩/换出”是换出到交换区(包括 zram)的部分。CPU 以一个核心占满为 100%,与 top 一致;GPU 来自 DRM 驱动报告的引擎时间。", - "desktop.memory.helpFigures": "“内存中”是进程现在占用的物理内存,状态栏和总计都只算这一项。“压缩/换出”是系统为这些进程压缩或写到磁盘上的内存,不计入“内存中”。CPU 和 GPU 是相邻两次读取之间的占用率,GPU 取最忙的那个图形引擎;面板打开后才读取 GPU,第二次读取起才有 GPU 占用。", + "desktop.memory.helpFigures": "“内存中”是进程现在占用的物理内存,状态栏和总计都只算这一项。“压缩/换出”是系统为这些进程压缩或写到磁盘上的内存,不计入“内存中”。CPU 和 GPU 是相隔至少 1 秒的两次读取之间的占用率,GPU 取最忙的那个图形引擎;面板打开后才读取 GPU,所以 GPU 占用要稍等片刻才显示。", "desktop.memory.percent": "{value}%", "desktop.memory.columnCPU": "CPU", "desktop.memory.columnGPU": "GPU", diff --git a/shared/platform-feature-matrix/features/memory-monitor.json b/shared/platform-feature-matrix/features/memory-monitor.json index 0a0b9b1012..7b10d442e5 100644 --- a/shared/platform-feature-matrix/features/memory-monitor.json +++ b/shared/platform-feature-matrix/features/memory-monitor.json @@ -27,7 +27,7 @@ ] }, "owner": "Workbench", - "verification": "运行带语言服务器、终端和 Markdown/HTML 预览的项目,点击状态栏内存项打开详情:顶部总计只算“内存中”且等于各类别之和,下一行是整个实例的压缩/换出、显存(仅 Windows)、CPU 和 GPU,没有数据的项不显示;按类别堆叠的条与图例显示 Lithe 主进程、语言服务器(插件名 · 语言)、插件服务、系统辅助进程(macOS 的 WebKit 进程)和其他子进程,0 字节的类别不显示;图例和进程列表右侧依次是 CPU、GPU、内存中、压缩/换出四列,列标题与数值右对齐,进程列表按内存中从大到小,超过上限的合计为“另有 N 项”。macOS 对照活动监视器:内存中 + 压缩/换出等于“内存”列,压缩/换出等于“压缩内存”列,CPU 对照“% CPU”(按单核计);Windows 对照任务管理器“详细信息”页:有专用工作集计数时内存中等于“内存(专用工作集)”,未提供该计数时对照普通工作集并确认不展示未取得的压缩/换出数据,显存对照“专用 GPU 内存”,CPU 对照“CPU”(占全部核心的比例),GPU 对照“GPU”(最忙引擎)。CPU 与 GPU 要打开详情后第二次采样才出现。弹窗内容不被截断;关闭详情后每 10 秒采样一次,打开时每 2 秒;读取失败时隐藏数字并显示无法读取,恢复后重新显示。从终端启动时 macOS 把 WebKit 进程归给终端,系统辅助进程不计入,应从 Finder 或 Dock 启动验证。macOS 状态栏只显示内存图标,悬停提示显示总计和 Lithe 主进程;Windows 状态栏显示总计与 Lithe 主进程数值。", + "verification": "运行带语言服务器、终端和 Markdown/HTML 预览的项目,点击状态栏内存项打开详情:顶部总计只算“内存中”且等于各类别之和,下一行是整个实例的压缩/换出、显存(仅 Windows)、CPU 和 GPU,没有数据的项不显示;按类别堆叠的条与图例显示 Lithe 主进程、语言服务器(插件名 · 语言)、插件服务、系统辅助进程(macOS 的 WebKit 进程)和其他子进程,0 字节的类别不显示;图例和进程列表右侧依次是 CPU、GPU、内存中、压缩/换出四列,列标题与数值右对齐,进程列表按内存中从大到小,超过上限的合计为“另有 N 项”。macOS 对照活动监视器:内存中 + 压缩/换出等于“内存”列,压缩/换出等于“压缩内存”列,CPU 对照“% CPU”(按单核计);Windows 对照任务管理器“详细信息”页:有专用工作集计数时内存中等于“内存(专用工作集)”,未提供该计数时对照普通工作集并确认不展示未取得的压缩/换出数据,显存对照“专用 GPU 内存”,CPU 对照“CPU”(占全部核心的比例),GPU 对照“GPU”(最忙引擎)。刚打开详情时 CPU 不出现瞬间的异常高值(相隔不足 1 秒的两次读取不计算占用率),GPU 要等打开后至少 1 秒的下一次采样才出现。弹窗内容不被截断;关闭详情后每 10 秒采样一次,打开时每 2 秒;读取失败时隐藏数字并显示无法读取,恢复后重新显示。从终端启动时 macOS 把 WebKit 进程归给终端,系统辅助进程不计入,应从 Finder 或 Dock 启动验证。macOS 状态栏只显示内存图标,悬停提示显示总计和 Lithe 主进程;Windows 状态栏显示总计与 Lithe 主进程数值。", "legacy": { "revision": "5a54c41aa37a4e6e6b68918a4b05765b9dd07a36", "macos": { @@ -47,5 +47,5 @@ "verificationStatus": "pending" } }, - "notes": "Viva:进程表由 sysinfo 原生读取,三端统一为“内存中”和“压缩/换出”两个量:macOS 用 proc_pid_rusage 物理占用减 TASK_VM_INFO 压缩量、压缩/换出为压缩量,并按 responsible PID 归属;Windows 内存中为专用工作集、压缩/换出为私有提交减专用工作集(上限值,含尚未触碰的已提交页),显存为 D3DKMT 专用显存段;Linux 内存中为常驻内存减共享页、压缩/换出为 VmSwap。CPU 与 GPU 由两次采样的累计时间差得出:macOS、Linux 按单核计,Windows 按全部核心计;GPU 取最忙引擎,只在详情打开时读取主进程和上次读数里的进程。Core 的 processMemory.summarize 把进程归到实例的各类别并求和,并返回下次采样所需的基线;工作台只负责采样、命名与呈现。原生窗口验收保持 pending。Linux 只有组件实现,不在矩阵平台范围内,读数尚未在真实 Linux 上核对。" + "notes": "Viva:进程表由 sysinfo 原生读取,三端统一为“内存中”和“压缩/换出”两个量:macOS 用 proc_pid_rusage 物理占用减 TASK_VM_INFO 压缩量、压缩/换出为压缩量,并按 responsible PID 归属;Windows 内存中为专用工作集、压缩/换出为私有提交减专用工作集(上限值,含尚未触碰的已提交页),显存为 D3DKMT 专用显存段;Linux 内存中为常驻内存减共享页、压缩/换出为 VmSwap。CPU 与 GPU 由相隔至少 1 秒的两次采样的累计时间差得出,间隔更短的读取改按基线里的 earlier 计数计算且基线不变:macOS、Linux 按单核计,Windows 按全部核心计;GPU 取最忙引擎,只在详情打开时读取主进程和上次读数里的进程。Core 的 processMemory.summarize 把进程归到实例的各类别并求和,并返回下次采样所需的基线;工作台只负责采样、命名与呈现。原生窗口验收保持 pending。Linux 只有组件实现,不在矩阵平台范围内,读数尚未在真实 Linux 上核对。" }