GithubHelp home page GithubHelp logo

Comments (8)

aaaaalbert avatar aaaaalbert commented on August 12, 2024

@fmetzger reports that on his 10.10.5 box, hw.physmem doesn't even exist as a key in sysctl.

from resource.

XuefengHuang avatar XuefengHuang commented on August 12, 2024

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.

lukpueh avatar lukpueh commented on August 12, 2024

$ 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.

michaelkux avatar michaelkux commented on August 12, 2024

$ 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.

pooledge avatar pooledge commented on August 12, 2024

$ 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.

aaaaalbert avatar aaaaalbert commented on August 12, 2024

Per PR #6, my proposed fix is to use sysctl hw.memsize.

Thank you all for testing and contibuting!

from resource.

durbrow avatar durbrow commented on August 12, 2024

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.

JustinCappos avatar JustinCappos commented on August 12, 2024

Always nice to get more clarity, even (way) after the fact. :)

from resource.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.