Skip to content

Instantly share code, notes, and snippets.

@tedcy
tedcy / content.md
Created December 7, 2024 09:15 — forked from baymaxium/content.md
知其然知其所以然,/PROC/MEMINFO之谜

原文:运维帮

转自:http://linuxperf.com/?p=142

作者:VMUNIX,已授权运维帮转发

/proc/meminfo是了解Linux系统内存使用状况的主要接口,我们最常用的”free”、”vmstat”等命令就是通过它获取数据的 ,/proc/meminfo所包含的信息比”free”等命令要丰富得多,然而真正理解它并不容易,比如我们知道”Cached”统计的是文件缓存页,manpage上说是“In-memory  cache  for  files read from the disk (the page cache)”,那为什么它不等于[Active(file)+Inactive(file)]?AnonHugePages与AnonPages、HugePages_Total有什么联系和区别?很多细节在手册中并没有讲清楚,本文对此做了一点探究。

负责输出/proc/meminfo的源代码是:fs/proc/meminfo.c : meminfo_proc_show()

@tedcy
tedcy / elf_format_cheatsheet.md
Created October 27, 2024 17:55 — forked from x0nu11byt3/elf_format_cheatsheet.md
ELF Format Cheatsheet

ELF Format Cheatsheet

Introduction

Executable and Linkable Format (ELF), is the default binary format on Linux-based systems.

ELF

Compilation