MoonPoint Support Logo

 

Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
October
Sun Mon Tue Wed Thu Fri Sat
   
24
   
2013
Months
Oct


Thu, Oct 24, 2013 11:24 pm

Determining the amount of physical memory on a OS X System

On an Apple OS X system, you can determine the amount of memory in the system by clicking on the Apple icon at the upper, left-hand corner of the screen and selecting "About This Mac".

About This Mac

If you need to determine the amount of memory from a shell prompt, you can use the sysctl command.

$ sysctl -n hw.memsize
4294967296

The sysctl -n hw.memsize command above shows my MacBook Pro laptop running OS X 10.8.3 has 4 GB of memory (4294967296 bytes = 4 GB).

Another sysctl option you could use is to query hw.physmem. But, be warned this will result in inaccurate results on systems with more than 2 GB of memory.

E.g., checking the amount of physical memory with the command sysctl -n hw.physmem on my MacBook Pro with 4 GB of memory results in the command telling me the system has 2 GB of memory rather than 4 GB.

$ sysctl -n hw.physmem
2147483648

If you wish to have the number displayed in GB rather than bytes, you can use memsize.py, which is a simple python script to convert the output of sysctl -n hw.physmem from bytes to gigabytes. You can run it from a shell prompt by typing python memsize.py.

$ python memsize.py
4 GB

[/os/os-x] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo