1

My Kubuntu laptop

 $ uname -a
   Linux jiggs 3.16.0-31-generic #43-Ubuntu SMP Tue Mar 10 17:37:36 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

has 6GiB of memory:

  # lshw -C memory
   *-firmware              
   description: BIOS
   vendor: TOSHIBA
   physical id: 0
   version: Version 6.50
   date: 11/26/2012
   size: 128KiB
   capacity: 8128KiB
   capabilities: isa pci pnp upgrade shadowing vesa cdboot bootselect edd int13floppytoshiba int13floppy720 int5printscreen int9keyboard int14serial int17printer acpi usb biosbootspecification netboot
  *-memory
   description: System Memory
   physical id: 1f
   slot: System board or motherboard
   size: 6GiB
  *-bank:0
      description: SODIMM DDR3 Synchronous 1600 MHz (0,6 ns)
      product: HMT351S6CFR8C-PB
      vendor: Hynix/Hyundai
      physical id: 0
      serial: 3F720214
      slot: DIMM0
      size: 4GiB
      width: 64 bits
      clock: 1600MHz (0.6ns)
   *-bank:1
      description: SODIMM DDR3 Synchronous 1600 MHz (0,6 ns)
      product: HMT325S6CFR8C-PB
      vendor: Hynix/Hyundai
      physical id: 1
      serial: 046584F8
      slot: DIMM2
      size: 2GiB
      width: 64 bits
      clock: 1600MHz (0.6ns)

from which I deduce I have (as my recollection of the specs at the time of buying serves me) 6GiBs.

However, other instruments report otherwise:

  $ vmstat -s
  4942348 K total memory
  3043944 K used memory
  1591504 K active memory
  1160736 K inactive memory
  1898404 K free memory
    93484 K buffer memory
   810816 K swap cache
  4194300 K total swap
   242832 K used swap
  3951468 K free swap
  7151425 non-nice user cpu ticks
    22453 nice user cpu ticks
   401211 system cpu ticks
 94036935 idle cpu ticks
    62616 IO-wait cpu ticks
      246 IRQ cpu ticks
     3030 softirq cpu ticks
        0 stolen cpu ticks
  1570974 pages paged in
  9494712 pages paged out
     1695 pages swapped in
    18084 pages swapped out
 87647428 interrupts
199120848 CPU context switches
1426162570 boot time
    41765 forks

or

 $ free -h
              total       used       free     shared    buffers     cached
Mem:          4,7G       2,9G       1,8G       209M        91M       796M
-/+ buffers/cache:       2,0G       2,7G
Swap:         4,0G       237M       3,8G

or, lastly,

 $ cat /proc/meminfo 
 MemTotal:        4942348 kB                                                                                                                                                                                                                                                    
 MemFree:         1892556 kB                                                                                                                                                                                                                                                    
 MemAvailable:    2483472 kB                                                                                                                                                                                                                                                    
 Buffers:           93844 kB                                                                                                                                                                                                                                                    
 Cached:           815388 kB                                                                                                                                                                                                                                                    
 SwapCached:       180524 kB                                                                                                                                                                                                                                                    
 Active:          1595312 kB                                                                                                                                                                                                                                                    
 Inactive:        1162484 kB                                                                                                                                                                                                                                                    
 Active(anon):    1128632 kB                                                                                                                                                                                                                                                    
 Inactive(anon):   934308 kB                                                                                                                                                                                                                                                    
 Active(file):     466680 kB                                                                                                                                                                                                                                                    
 Inactive(file):   228176 kB                                                                                                                                                                                                                                                    
 Unevictable:          68 kB                                                                                                                                                                                                                                                    
 Mlocked:              68 kB                                                                                                                                                                                                                                                    
 SwapTotal:       4194300 kB                                                                                                                                                                                                                                                    
 SwapFree:        3951468 kB                                                                                                                                                                                                                                                    
 Dirty:                 0 kB                                                                                                                                                                                                                                                    
 Writeback:             0 kB                                                                                                                                                                                                                                                    
 AnonPages:       1671124 kB                                                                                                                                                                                                                                                    
 Mapped:           296016 kB                                                                                                                                                                                                                                                    
 Shmem:            214376 kB                                                                                                                                                                                                                                                    
 Slab:             167272 kB                                                                                                                                                                                                                                                    
 SReclaimable:     130004 kB                                                                                                                                                                                                                                                    
 SUnreclaim:        37268 kB                                                                                                                                                                                                                                                    
 KernelStack:        9552 kB                                                                                                                                                                                                                                                    
 PageTables:        56688 kB                                                                                                                                                                                                                                                    
 NFS_Unstable:          0 kB                                                                                                                                                                                                                                                    
 Bounce:                0 kB                                                                                                                                                                                                                                                    
 WritebackTmp:          0 kB                                                                                                                                                                                                                                                    
 CommitLimit:     6665472 kB                                                                                                                                                                                                                                                    
 Committed_AS:    6178500 kB                                                                                                                                                                                                                                                    
 VmallocTotal:   34359738367 kB                                                                                                                                                                                                                                                 
 VmallocUsed:      354304 kB                                                                                                                                                                                                                                                    
 VmallocChunk:   34359375180 kB                                                                                                                                                                                                                                                 
 HardwareCorrupted:     0 kB                                                                                                                                                                                                                                                    
 AnonHugePages:    638976 kB                                                                                                                                                                                                                                                    
 HugePages_Total:       0
 HugePages_Free:        0
 HugePages_Rsvd:        0
 HugePages_Surp:        0
 Hugepagesize:       2048 kB
 DirectMap4k:       75328 kB
 DirectMap2M:     5027840 kB

This last output is possibly important because it does not report any hardware problem: HardwareCorrupted = 0 kB. Whence the discrepancy?

EDIT: @Sobrique rightly points out I should have included the BIOS info:

  Total Memory Size   6140MB

Edit2:

 # dmesg | grep Memory
 [    0.000000] Memory: 5957056K/6166700K available (7384K kernel code, 1145K rwdata, 3408K rodata, 1336K init, 1444K bss, 209644K reserved)
 [    1.201086] [drm] Memory usable by graphics device = 2048M
0

2 Answers 2

1

Strange thing is, after a reboot the discrepancy is no longer there:

 $ dmesg | grep Memory
 [    0.000000] Memory: 5957056K/6166700K available (7384K kernel code, 1145K rwdata, 3408K rodata, 1336K init, 1444K bss, 209644K reserved)
 [    1.312970] [drm] Memory usable by graphics device = 2048M
 $ free -h
              total       used       free     shared    buffers     cached
Mem:          5.7G       3.8G       1.9G       334M       274M       1.6G
-/+ buffers/cache:       1.9G       3.8G
Swap:         6.0G         0B       6.0G
  $ vmstat -s | head -1
  5987640 K total memory
  $ head -1 /proc/meminfo
  MemTotal:        5987640 kB

I am relieved of course, yet intrigued: I have no idea as to what may cause a temporary decrease in the available memory.

3
  • [drm] Memory usable by graphics device = 2048M might a a clue—maybe it's been given to the graphics hardware?
    – derobert
    Commented Mar 18, 2015 at 17:45
  • @derobert The same amount is allocated to the graphics hardware when the total tallies, and when it doesn't, so it seems unlikely, to me, that it may make a difference. Commented Mar 18, 2015 at 18:57
  • @MariusMatutiae For Intel graphics cards, the 2048M is the max shared memory amount that can be given to the GPU; it varies dynamically ­– see this answer. Not sure if this memory would be included in free's total, but if not, it could explain your issue.
    – tanius
    Commented Aug 20, 2016 at 18:28
0

4G is a special number, because it's 2^32. This is quite a good indicator as to where the root cause might be. It's not uncommon to run into 32 and 31bit memory limits. You've gone past this - you're on 4.7G - so it's not a problem with your 32bit-ness.

With a bit of digging, suggests it's not uncommon to reserve system RAM for your graphics card.

https://askubuntu.com/questions/82917/ubuntu-detects-only-3-2gb-ram-on-a-64bit-os

Either that or it's BIOS related:

https://askubuntu.com/questions/80721/only-3-2-gb-of-memory-being-used-on-a-64-bit-system http://forums.fedoraforum.org/showthread.php?t=297556

1
  • Regretfully (for me!), my BIOS recognizes the full amount of memory present, and the total memory assigned to the graphics card is a mere 256MB Commented Mar 18, 2015 at 12:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .