Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

(This is a repost of my question on SuperUser.com, hopefully it's better suited here ).

I've happily installed Linux on my MacBook Pro with 4 GB of RAM, but I only get 3.6 GB available:

robert@raptor ~$ free -m
             total       used       free     shared    buffers     cached
Mem:          3684       2184       1500          0         83       1096
-/+ buffers/cache:       1004       2680
Swap:         6149          0       6149

I'm running a 64-bit kernel so this should not be a problem:

robert@raptor ~$ uname -a
Linux raptor 2.6.34.7-0.5-desktop #1 SMP PREEMPT 2010-10-25 08:40:12 +0200 x86_64 x86_64 x86_64 GNU/Linux

What can I do to get the whole 4 GB available?


Update: this is what I get when running top on MacOS X:

PhysMem: 540M wired, 640M active, 231M inactive, 1411M used, 2685M free.

where used + free = 4096 MB.

Update 2: There's a thread on MacRumors.com where a user complains of the same problem with Windows 7/64 bit.

Update 3: /proc/meminfo output:

MemTotal:        3773288 kB
MemFree:         1164244 kB
Buffers:          109096 kB
Cached:          1270520 kB
SwapCached:            0 kB
Active:          1446756 kB
Inactive:         962728 kB
Active(anon):     803404 kB
Inactive(anon):   230556 kB
Active(file):     643352 kB
Inactive(file):   732172 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       6297596 kB
SwapFree:        6297596 kB
Dirty:               792 kB
Writeback:             0 kB
AnonPages:       1029880 kB
Mapped:           185096 kB
Shmem:              4096 kB
Slab:             131260 kB
SReclaimable:     106212 kB
SUnreclaim:        25048 kB
KernelStack:        2680 kB
PageTables:        21248 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     8184240 kB
Committed_AS:    3113016 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      123884 kB
VmallocChunk:   34359596028 kB
HardwareCorrupted:     0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       54444 kB
DirectMap2M:     3852288 kB

Memory info from dmesg:

[    0.000000] Memory: 3759972k/5242880k available (4780k kernel code, 1336600k absent, 146308k reserved, 6603k data, 892k init)
share|improve this question

2 Answers 2

up vote 4 down vote accepted

Some of the memory is used by the hardware -- for example, most MacBook Pros have 256MB of main memory used by the graphics adaptor. OS X knows about this and can account for it, but Linux doesn't. Your Linux installation has access to all of the available memory.

share|improve this answer

Mike Scott is right, and to give some ground to his statements I want to add something.

The output from /proc/meminfo you give is quite interesting. It give you a total memory of 3773288 kB (or 3.6 GB). The procfs documentation tells you that MemTotal as reported by meminfo corresponds to "Total usable ram (i.e. physical ram minus a few reserved bits and the kernel binary code)". So you have about 400 MB used for the firmware and the kernel image. Firmware could include BootCamp and the graphical memory. For the kernel, it is a bit more complicated to know, you would have to properly unzipped your kernel (/boot/vmlinuz...) to know the right size it takes in memory.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.