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

Open
#1,780 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust

Research direction

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.

Written by the indexing model from the issue text.

Description

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. / 我已从报告中移除敏感信息和个人数据。
Dominant language
TypeScript
Stars
1.8k
Forks
151
Avg merge
11h 41m
Merged PRs (30d)
416

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from 1lck/Lithe-IDEA

All issues in 1lck/Lithe-IDEA

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.