CLion:2019.3.6
平台:Macbook Pro 10.12.6
C语言源码程序:Makefile格式的linux系统的top命令源码。
一、背景
最近在研究JVM虚拟机内存的占用情况,通过top命令看到进程的RES占用的内存很大,已经超过了java虚拟机设置的大小,所以想弄明白top的RES的数据是怎么计算出来的,但是前提是需要将top的源码下载到本地进行研究。
二、源码地址
top命令的项目是procps-ng项目,地址是:https://gitlab.com/procps-ng/procps
三、项目导入
3.1 下载源码
1、执行如下命令,下载源码:
git clone git@gitlab.com:procps-ng/procps.git
如果遇到如下错误,请先在gitlab上添加自己的公钥:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
2、现在源码完成后,procps项目如下所示:
192