Skip to content

[Bug] memoryPressurePercent 使用 system-wide 计算,与 shortMemoryString 的 RSS 口径不一致 #19

@ShadyUnderLight

Description

@ShadyUnderLight

问题描述

shortMemoryString 用的是 memoryUsedBytes(RSS,来自 vm_statistics64 的 active + inactive + wired + compressor),但 memoryPressurePercent 显示的是 system-wide memory pressure 百分比。两者在 UI 中同时出现,但含义不同:

  • shortMemoryString:用户进程视角的"已用内存"
  • memoryPressurePercent:系统视角的"内存压力"

用户看到"已用 8G / 压力 95%"会很困惑。

预期结果

内存指标口径一致,或明确区分 system pressure 和 process RSS。

建议方案

memoryUsedBytes 改名为 systemMemoryUsedBytes 并在 SystemSummary 中加注释说明计算方式。shortMemoryString 显示的数和 memoryPressurePercent 是不同维度,应在 UI 上用不同标签区分。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions