Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
516 views
in Technique[技术] by (71.8m points)

/proc/kcore文件特别大,感觉很不正常,有人能解释一下么?

偶然发现这个问题,执行这个命令,网上说是内存的映射,是不占用实际空间的,可是还是感觉怪怪的,希望专业人士解释一下。

# ll /proc/kcore -h
-r-------- 1 root root 128T Mar 15 14:40 /proc/kcore

clipboard.png


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

摘自一段原文解释:
/proc/kcore is like an "alias" for the memory in your computer. Its
size is the same as the amount of RAM you have, and if you read it as
a file, the kernel does memory reads.
其大致意识就是 kcore 相当于内存的别名,变相代表着内存,可以当做内存文件执行内存读取,其实通过不同的命令查看该文件所显示的大小也是不一致的,例如:
ls -lh /proc/kcore
du -hs /proc/kcore
你可以试试。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...