[Bug] Windows Server 2022 上私有工作集采样返回零并使宿主测试失败

Aperta
#1,780 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start with windows/tauri/src-tauri/src/memory.rs and the named test memory::platform::tests::current_process_private_working_set_is_available; reproduce it on Windows Server 2022 with the command in the report. Compare the private working set result with the ordinary working set and check how the implementation handles an unavailable or zero value. Done when the test passes with a valid positive sample, or unavailable data is reported without being treated as a successful zero.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:other bug P2 platform:windows review: high
Platform / 平台

Windows

Area / 模块

Other / 其他

Lithe version / Lithe 版本

源码测试:preview 0d38aca1b008acdb80db677b11435ceab68c67c5 与 PR #1478 的本地合并树;windows/tauri/src-tauri/src/memory.rs 相对该 preview 未修改。未运行已发布的安装包。

Priority / 优先级

P2 / 后续考虑:目前不着急,可安排到后续版本

OS and architecture / 操作系统与架构

Windows Server 2022 Datacenter 21H2,build 20348.859,x86_64;云端 Windows 主机,经 SSH 执行原生测试。

Environment / 环境信息
  • 测试为 Windows 源码 debug 构建,不涉及项目工作区或插件;没有启动产品 GUI。
  • 8 个逻辑处理器,约 16 GiB 内存;Rust 1.99.1、Cargo 1.99.1。
  • 测试时点为 2026-11-07 11:12(UTC+8)附近;未调查其他 Windows 版本或发布包。
Steps to reproduce / 复现步骤
  1. 在上述 Windows 环境编译 Windows Tauri 宿主的测试目标。
  2. 运行 cargo test --manifest-path windows/tauri/src-tauri/Cargo.toml memory::platform::tests::current_process_private_working_set_is_available -- --exact。
  3. 观察当前进程内存采样结果及断言。
Expected behavior / 预期行为

测试进程有实际驻留内存时,私有工作集采样返回可用的正数;若系统不能提供该指标,不应把不可用值当作成功的零字节。

Actual behavior / 实际行为

测试中的 application_memory_usage() 成功返回,但 lithe_bytes 为 0,正数断言失败。未实测产品界面或诊断包;根据当前生产采样代码,这可能让使用该结果的内存数值不准确,影响范围待产品复验。

独立 Win32 调用在同一系统上返回成功、普通工作集约 60 MB,而 PROCESS_MEMORY_COUNTERS_EX2.PrivateWorkingSetSize 为 0。微软文档列出此结构较新的客户端最低支持版本;是否与服务器更新水平有关尚待确认,不能将其当作已证实根因。参考:https://learn.microsoft.com/en-us/windows/win32/api/psapi/ns-psapi-process_memory_counters_ex2

Logs or diagnostic output / 日志或诊断输出
memory::platform::tests::current_process_private_working_set_is_available ... FAILED
assertion failed: usage.lithe_bytes > 0
Independent Win32 probe: success=True, workingSet=60203008, privateWorkingSet=0
Screenshots or recordings / 截图或录屏

未采集:这是命令行测试与独立 Win32 查询,未执行 GUI 工作流。

Checklist / 提交前检查
  • I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复报告。
  • I removed secrets and personal data from the report. / 我已从报告中移除敏感信息和个人数据。
Lingua principale
TypeScript
Stelle
1.8k
Fork
151
Merge medio
11h 41m
PR unite (30g)
416

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di 1lck/Lithe-IDEA

Tutte le issue di 1lck/Lithe-IDEA

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.