Comments (8)
@fmetzger reports that on his 10.10.5 box, hw.physmem
doesn't even exist as a key in sysctl
.
from resource.
I tested on my MacBookPro11,1 running Mac OS X 10.10.5.
172-16-29-190:~ Xuefeng$ sysctl hw.memsize
hw.memsize: 8589934592
172-16-29-190:~ Xuefeng$ sysctl hw.physmem
hw.physmem: 2147483648
172-16-29-190:~ Xuefeng$ uname -v
Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64
from resource.
$ uname -v; sysctl hw.physmem; sysctl hw.memsize;
Darwin Kernel Version 13.4.0: Wed Mar 18 16:20:14 PDT 2015; root:xnu-2422.115.14~1/RELEASE_X86_64
hw.physmem: 2147483648
hw.memsize: 4294967296
from resource.
$ uname -v; sysctl hw.physmem; sysctl hw.memsize;
Darwin Kernel Version 13.4.0: Wed Mar 18 16:20:14 PDT 2015; root:xnu-2422.115.14~1/RELEASE_X86_64
hw.physmem: 2147483648
hw.memsize: 17179869184
from resource.
$ uname -v; sysctl hw.physmem; sysctl hw.memsize;
Darwin Kernel Version 12.6.0: Wed Mar 18 16:23:48 PDT 2015; root:xnu-2050.48.19~1/RELEASE_X86_64
hw.physmem: 2147483648
hw.memsize: 17179869184
from resource.
Per PR #6, my proposed fix is to use sysctl hw.memsize
.
Thank you all for testing and contibuting!
from resource.
In case no one figured this out (which they did)...
In sysctl.h,
hw.physmem is documented to be an int (i.e. 32 bit signed int).
hw.memsize is documented to be a uint64_t (i.e. 64 bit unsigned int).
The value you are getting for hw.physmem is the maximum value a 32-bit signed int can hold.
from resource.
Always nice to get more clarity, even (way) after the fact. :)
from resource.
Related Issues (6)
- Rewrite bandwidth code so that it can work both ways HOT 3
- Mac_BSD_resources.py is not invoked for benchmarking Seattle installation in BSD,instead Linux_resources.py is invoked HOT 4
- Improve benchmarking error message when vesselinfo file is missing
- Mac_BSD_resources fails if sysctl lacks kern.ipc.maxsockets key HOT 6
- Clean up `Mac_BSD_resources.py`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from resource.