linux下一个线程占用多少内存

linux下一个线程占用多少内存,第1张

Linux中线程本身是有自己的栈的,这个空间默认是10240,单位是K,所以默认占用10M的内存,但是这是最少的,如果线程中,程序员也是用了内存,那就是大于10M,所以线程最低占用的内存通过ulimit -s查看

1、查看物理CPU的个数

[root@MysqlCluster01 ~]# cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l

1

2、查看逻辑CPU的个数

[root@MysqlCluster01 ~]# cat /proc/cpuinfo |grep "processor"|wc -l

4

3、查看CPU是几核(即,核心数)

[root@MysqlCluster01 ~]# cat /proc/cpuinfo |grep "cores"|uniq

cpu cores: 4

4、查看CPU的主频

[root@MysqlCluster01 ~]# cat /proc/cpuinfo |grep MHz|uniq

cpu MHz: 2499.982

5、当前 *** 作系统内核信息

[root@MysqlCluster01 ~]# uname -a

Linux MysqlCluster01 2.6.32-431.20.3.el6.x86_64 #1 SMP Thu Jun 19 21:14:45 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

6、当前 *** 作系统发行版信息

[root@MysqlCluster01 ~]# cat /etc/issue

CentOS release 6.4 (Final)

Kernel \r on an \m

7、内存使用情况

[root@MysqlCluster01 ~]# free -m

total used free sharedbuffers cached

Mem: 7863 2738 5125 0141835

-/+ buffers/cache: 1761 6102

Swap: 3967 0 3967


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/8319678.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-15
下一篇 2023-04-15

发表评论

登录后才能评论

评论列表(0条)

保存