文章目录
- 1 Monitor
- 2 命令模式
- 2.1 system_profiler SPHardwareDataType
- 2.2 sysctl
- 3 Summary
1 Monitor
https://support.apple.com/zh-cn/HT201464
这个是 Mac 自带的监视器,可以监视 包括 CPU,内存在内的多种资源,使用简单,可以针对某个进程进行 Kill。

2 命令模式
2.1 system_profiler SPHardwareDataType

2.2 sysctl
sysctl 是可以提取内核状态的命令,具体用法可以 man sysctl 获取全面的手册,以下是从手册中获取的一些与 CPU 有关的指标。
| Name | Type | Changeable |
|---|---|---|
| hw.activecpu | integer | no |
| hw.cpu64bit_capable | integer | no |
| hw.cpufamily | integer | no |
| hw.cpufrequency | integer | no |
| hw.cpufrequency_max | integer | no |
| hw.cpufrequency_min | integer | no |
| hw.cpusubtype | integer | no |
| hw.cputhreadtype | integer | no |
| hw.cputype | integer | no |
| hw.l1dcachesize | integer | no |
| hw.l1icachesize | integer | no |
| hw.l2cachesize | integer | no |
| hw.l3cachesize | integer | no |
| hw.logicalcpu | integer | no |
| hw.logicalcpu_max | integer | no |
| hw.ncpu | integer | no |
| hw.physicalcpu | integer | no |
| hw.physicalcpu_max | integer | no |
获取系统最大的进程数。
sysctl kern.maxproc
为每个 uid 配置最大的进程数。
sysctl kern.maxprocperuid=1000
3 Summary
Mac 作为日常开发的主力机,理解其物理资源的查询方法是很有必要的。
最后
以上就是沉静羊最近收集整理的关于Mac CPU 相关1 Monitor2 命令模式3 Summary的全部内容,更多相关Mac内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复