Determine physical mem size programmatically on OSX

前端 未结 4 1179
天命终不由人
天命终不由人 2020-12-29 14:33

We\'re trying to find out how much physical memory is installed in a machine running Mac OS X. We\'ve found the BSD function sysctl(). The problem is this function wants to

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-29 14:59

    From Obtaining a Mac’s System Profiler data from shell:

    Use system_profiler.

提交回复
热议问题