/proc/pid/status中关于内存信息源码
//源码路径: /fs/proc/task_mmu.c
void task_mem(struct seq_file *m, struct mm_struct *mm)
{
unsigned long data, text, lib, swap;
unsigned long hiwater_vm, total_vm, hiwater_rss, total_rss;
/*
* Note: to minimize their overhead, mm maintains hiwater_vm and
* hiwater_rss only when about to *lower* total_vm or rss. Any
* collector of these hiwater stats must therefore get total_vm
* and rss too, which will usually be the higher. Barriers? not
* worth the effort, such snapshots can always be inconsistent.
*/
hiwater_vm = total_vm = mm->total_vm;
if (hiwater_vm < mm->hiwater_vm)
hiwater_vm = mm->hiwater_vm;
hiwater_rss = total_rss = get_mm_rss(mm

本文聚焦于Linux系统中进程状态文件`/proc/pid/status`,特别是涉及内存信息的部分。通过源码分析,探讨了相关字段的含义,为理解Linux内存管理提供帮助。
最低0.47元/天 解锁文章
952

被折叠的 条评论
为什么被折叠?



