Memory: VSS/RSS/PSS/USS

【k8s pod container内存指标说明】 容器的工作集使用量作为内存使用量的观察项,但随着后续使用过程中发现该指标上升到一定大小后就会维持不变,并不像应用实际内存使用量,没出现波动;问题剖析 阅读详情

From: http://netcome.javaeye.com/blog/746793

 

Terms
VSS - Virtual Set Size 虚拟耗用内存(包含共享库占用的内存)
RSS - Resident Set Size 实际使用物理内存(包含共享库占用的内存)
PSS - Proportional Set Size 实际使用的物理内存(比例分配共享库占用的内存)
USS - Unique Set Size 进程独自占用的物理内存(不包含共享库占用的内存)
一般来说内存占用大小有如下规律:VSS >= RSS >= PSS >= USS
 
Overview
 
The aim of this post is to provide information that will assist in interpreting memory reports from various tools so the true memory usage for Linux processes and the system can be determined.
 
Android has a tool called procrank (/system/xbin/procrank), which lists out the memory usage of Linux processes in order from highest to lowest usage. The sizes reported per process are VSS, RSS, PSS, and USS.
 
For the sake of simplicity in this description, memory will be expressed in terms of pages, rather than bytes. Linux systems like ours manage memory in 4096 byte pages at the lowest level.
 
VSS (reported as VSZ from ps) is the total accessible address space of a process. This size also includes memory that may not be resident in RAM like mallocs that have been allocated but not written to. VSS is of very little use for determing real memory usage of a process.
 
RSS is the total memory actually held in RAM for a process. RSS can be misleading, because it reports the total all of the shared libraries that the process uses, even though a shared library is only loaded into memory once regardless of how many processes use it. RSS is not an accurate representation of the memory usage for a single process.
 
PSS differs from RSS in that it reports the proportional size of its shared libraries, i.e. if three processes all use a shared library that has 30 pages, that library will only contribute 10 pages to the PSS that is reported for each of the three processes. PSS is a very useful number because when the PSS for all processes in the system are summed together, that is a good representation for the total memory usage in the system. When a process is killed, the shared libraries that contributed to its PSS will be proportionally distributed to the PSS totals for the remaining processes still using that library. In this way PSS can be slightly misleading, because when a process is killed, PSS does not accurately represent the memory returned to the overall system.
 
USS is the total private memory for a process, i.e. that memory that is completely unique to that process. USS is an extremely useful number because it indicates the true incremental cost of running a particular process. When a process is killed, the USS is the total memory that is actually returned to the system. USS is the best number to watch when initially suspicious of memory leaks in a process.
 
For systems that have Python available, there is also a nice tool called smem that will report memory statistics including all of these categories.
 
# procrank
procrank
PID      Vss      Rss      Pss      Uss cmdline
481   31536K   30936K   14337K    9956K system_server
475   26128K   26128K   10046K    5992K zygote
526   25108K   25108K    9225K    5384K android.process.acore
523   22388K   22388K    7166K    3432K com.android.phone
574   21632K   21632K    6109K    2468K com.android.settings
521   20816K   20816K    6050K    2776K jp.co.omronsoft.openwnn
474    3304K    3304K    1097K     624K /system/bin/mediaserver
37     304K     304K     289K     288K /sbin/adbd
29     720K     720K     261K     212K /system/bin/rild
601     412K     412K     225K     216K procrank
   1     204K     204K     185K     184K /init
35     388K     388K     182K     172K /system/bin/qemud
284     384K     384K     160K     148K top
27     376K     376K     148K     136K /system/bin/vold
261     332K     332K     123K     112K logcat
33     396K     396K     105K      80K /system/bin/keystore
32     316K     316K     100K      88K /system/bin/installd
269     328K     328K      95K      72K /system/bin/sh
26     280K     280K      93K      84K /system/bin/servicemanager
45     304K     304K      91K      80K /system/bin/qemu-props
34     324K     324K      91K      68K /system/bin/sh
260     324K     324K      91K      68K /system/bin/sh
600     324K     324K      91K      68K /system/bin/sh
25     308K     308K      88K      68K /system/bin/sh
28     232K     232K      67K      60K /system/bin/debuggerd

嵌入式和服务器Linux系统下free -m Memory统计信息解析(VSS/RSS/PSS/USS) 由于MAP_SHARED FLAG的匿名页面,用的vm_ops是shmem_vm_ops,其PAGE FAULT中是从SHMEM分配页面的,其调用路径上的关键函数shmem_add_to_page_cache:将分配的页面增加到了NR_FILE_PAGES和NR_SHMEM上面:所以可以得到,SHARED的确实是BUFF/CACHE的一部分,不是USED的一部分,最早的说法更对。 阅读详情

相关推荐

C/C++跨平台获取进程内存:VSS、RSS、USS原理与实现

进程内存管理是操作系统和系统编程的核心概念,它决定了程序如何分配和使用物理及虚拟内存资源。其基本原理涉及虚拟地址空间、物理页帧映射以及内存共享机制。理解这些原理对于性能调优、资源监控和稳定性保障具有重要技术价值,尤其在开发后台服务、性能监控工具和资源管理组件时。在实际应用场景中,开发者常需通过编程方式精确获取进程的内存消耗指标,如虚拟内存大小(VSS)、物理驻留集(RSS)和独占物理内存(USS),以排查内存泄漏或实现资源监视器。本文聚焦于跨平台(Windows/Linux)获取这些关键内存指标的具体实现方

weixin_34195546的博客 920

名词解释:Linux内存管理之RSS和VSZ

Linux内存管理中不管是top命令还是pmap命令,都会有RSS和VSZ这两个名词,这里解释一下: RSS( Resident Set Size )常驻内存集合大小,表示相应进程在RAM中占用了...

cuanraoyi1969的博客 2326

使用python统计Android应用内存以及CPU占用

内存占用 VSS- Virtual Set Size 虚拟耗用内存(包含共享库占用的内存) RSS- Resident Set Size 实际使用物理内存(包含共享库占用的内存) PSS- Proportional Set Size 实际使用的物理内存(比例分配共享库占用的内存) USS- Unique Set Size 进程独自占用的物理内存(不包含共享库占用的内存) 获取USS:procra...

weixin_43835637的博客 3178

redis info命令 memory内存信息说明

源文地址 https://www.runoob.com/redis/server-info.html memory : 内存信息,包含以下域: used_memory : 由 Redis 分配器分配的内存总量,以字节(byte)为单位 used_memory_human : 以人类可读的格式返回 Redis 分配的内存总量 used_memory_rss : 从操作系统的角度,返回 Redis 已分配的内存总量(俗称常驻集大小)。这个值和 top 、 ps 等命令的输出一致。 used_memory_.

wejack的专栏 3365

Workbench中基于nCode的列车转向架随机振动疲劳寿命预测方法

本文详细介绍了在ANSYS Workbench中结合nCode进行列车转向架随机振动疲劳寿命预测的完整方法。通过几何清理、模态分析、PSD载荷定义及随机振动求解,并重点阐述了nCode中Dirlik等疲劳算法的选择与应用,为轨道交通关键部件的可靠性设计提供了系统的仿真分析流程与工程实践指导。

weixin_29234423的博客 482

【科研导航】【计算机视觉与图像处理】从顶刊到潜力股:跨学科(电子/电气/信息)SCI期刊投稿全景图

本文全面解析了计算机视觉与图像处理领域的SCI期刊投稿策略,涵盖从顶刊到潜力股的各类期刊特点。重点介绍了IEEE Transactions系列、Elsevier旗舰期刊以及二区优质期刊的审稿偏好和投稿技巧,特别适合电子/电气/信息交叉学科的研究者。文章还提供了三区、四区期刊的实用投稿建议,帮助科研新手快速找到适合的发表平台。

weixin_30897233的博客 93

linux中pss用法,[Linux] Memory: VSS/RSS/PSS/USS

TermsVSS- Virtual Set Size虚拟耗用内存(包含共享库占用的内存)RSS- Resident Set Size实际使用物理内存(包含共享库占用的内存)PSS- Proportional Set Size实际使用的物理内存(比例分配共享库占用的内存)USS- Unique Set Size进程独自占用的物理内存(不包含共享库占用的内存)一般来说内存占用大小有如下规律:VSS&g...

weixin_30495469的博客 648

基于Landsat-8数据的山西省吕梁市地表温度反演研究过程(大气校正法)

1.数据下载:本实验采用的数据是 ①从地理空间数据云下载的来自landsat8 卫星,云量<=1%,时间为2017年5月12日的山西省吕梁市影像数据。为全面覆盖吕梁市,选用了两片影像。 ②吕梁市边界矢量图 2.数据预处理 ...

weixin_45747376的博客 6620

Android内存之VSS/RSS/PSS/USS

Terms VSS- Virtual Set Size 虚拟耗用内存(包含共享库占用的内存) RSS- Resident Set Size 实际使用物理内存(包含共享库占用的内存) PSS- Proportional Set Size 实际使用的物理内存(比例分配共享库占用的内存) USS- Unique Set Size 进程独自占用的物理内存(不包含共享库占用的内存) 一般来说内存占用大小...

chqj_163的专栏 688

10分钟上手YOLOv11:最强姿态估计模型来了,代码开源,效果炸裂!

【10分钟玩转YOLOv11实时姿态估计】🚀 YOLOv11作为YOLO家族最新成员,在速度、精度和易用性上全面升级,尤其适用于姿态估计等复杂视觉任务。本文带您快速掌握: 1️⃣ 核心概念:姿态估计即识别人体17个关键点(如关节部位)并连接成数字骨架,是智能健身、体感游戏等应用的基础。 2️⃣ 技术优势: 超轻量级(最小仅2.9M参数) 极速推理(GPU仅1.7ms) 高精度(COCO mAP@50-95达50%) 3️⃣ 三步实操: ① 安装:pip install ultralytics ② 准备人物

weixin_41246802的博客 1797

【open judge】【程设】魔兽世界三开战!

#程设 魔兽世界三---开战!--------原以为会很容易ac,没想到写了好久,看来自己的水平还是亟待提高啊!有几个比较有趣的点:1. typeid(#include&lt;typeinfo&gt;)还是比较好用的,特别是本题当战士为wolf,iceman, dragon, ninja时有特殊技能,那么用typeid判断一下就很方便了。2. 对于这种输出很复杂的问题,往往通过使用文件的输入输出再...

weixin_40841416的博客 6078

内存耗用:VSS/RSS/PSS/USS

转:http://blog.csdn.net/adaptiver/article/details/7084364TermsVSS- Virtual Set Size 虚拟耗用内存(包含共享库占用的内存) RSS- Resident Set Size 实际使用物理内存(包含共享库占用的内存) PSS- Proportional Set Size 实际使用的物理内存(比例分配共享库占用的内存) U

Kingous-惊蛰 641

TPAMI 2024 | MO-MIX:基于深度强化学习的多目标多智能体协同决策

深度强化学习(RL)已被广泛应用于解决复杂的决策问题。在许多现实世界的场景中,任务通常有多个相互冲突的目标,并且可能需要多个智能体进行合作,这些是多目标多智能体决策问题。然而,在这个交叉领域的研究工作还相对较少。现有的方法仅限于单独的领域,并且只能处理具有单一目标的多智能体决策,或者具有单一智能体的多目标决策。在本文中,我们提出了MO-MIX来解决多目标多智能体强化学习(MOMARL)问题。我们的方法基于集中训练与分散执行(CTDE)框架。

小白学视觉 1138

linux 进程的vss rss uss,内核/内存管理中的VSS/RSS/PSS/USS

转自:http://www.douban.com/note/161471809/RSS is the total memory actually held in RAM for a process.RSS can be misleading, because it reports the total all of the shared libraries that the process uses...

weixin_39614637的博客 192

YOLOv11改进 | Conv/卷积篇 | 利用Hype-YOLO提出MANet增强YOLOv11特征提取能力

本文给大家带来的最新改进机制是由Hype-YOLO提出的MANet结构,其是一种C3、C2f、C3k2的升级版,用于增强特征提取能力。MANet可以理解为C2f的升级版,其整合了DSConv和C2f结构,这些模块的组合使得信息流动更加丰富,有助于在训练过程中提高梯度流动,从而增加基础特征的语义深度。官方发布的数据中HypeYOLO的精度是高于YOLOv11的,本文内容包含MAnet替换C3k2的教程以及原理介绍。欢迎大家订阅我的专栏一起学习YOLO,购买专栏读者联系读者入群获取进阶项目文件!

Snu77的博客 2177

基于simulink构建一个完整的航空航天器姿态控制与导航仿真模型

航空航天器的姿态控制与导航系统是确保飞行器稳定运行和精确执行任务的核心技术。其目标是通过传感器获取飞行器的状态信息,并利用控制器调整飞行器的姿态,使其按照预定轨迹飞行。基于MATLAB/Simulink平台进行航空航天器姿态控制与导航系统的建模与仿真,可以帮助研究者验证算法性能并优化系统的动态响应。本项目旨在构建一个完整的航空航天器姿态控制与导航仿真模型,包括飞行器动力学建模、传感器模块设计、控制器实现以及导航算法仿真,并通过仿真分析其性能。

xiaoheshang_123的博客 277

android memory详解

了解系统详细的memory使用的情况

qq_34694875的博客 1345

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

上一篇: New Gingerbread API: StrictMode
下一篇: Linux进程虚拟内存和物理内存
CodeJoker
博客等级 码龄18年 50粉丝 37原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址