RAM in lshw compared to free

ram
free-vs-lshw
#1

this one feels like it has such a simple answer, but somehow i am missing it :crazy_face:

lshw, dmidecode and memtest86 all tell me i have 2x 4 GiB (or 4096 MB) of RAM which i have also seen with my eyes when dismantling the machine. however, free, htop and conky all agree that i have 6.47 GiB (6624 MiB from free). i get that there is a conversion between GB and GiB and i would even swear that in ubuntu 16.04 (i’m now running bodhi based on 18.04) my readings were closer to (if not exactly) 7.45.

when i first noticed this, i ran across a reddit answer to a similar question that pointed concerned folks to linux ate my ram! i get the ideas of buffer and cache. htop makes both pretty clear. i know that’s not what i’m looking at.

1 Like
#2

In that link it says you should use free -m and check how much is available. That said, I’m sure conky uses a generic free command or whatever is the most used one.

#3

right. in general i was moreso interested in the total column. i understand well enough from htop what is being used and by what process. i just don’t get why the total is so different from what i know to physically be present.

#4

Ah yes, I forgot the actual question. So all the hardware or RAM specific software is showing the correct amount of RAM, but free does not. Weird, but it shouldn’t be a big issue, I guess.

You could also try #2 and #3 from here.

#5

agreed that it isn’t really an issue. i’m not a poweruser by an means. i rarely use more than 3 gib before i close programs just to de-clutter.

#6

that is one of the pages i had gone through before posting. i wanted to make doubly and triply sure that i was looking at all of the possible angles. both of those report the same 6.47 (or so) as free.

#7

Maybe you could write a program that allocates 7GB RAM and see how it goes. If the system truly assumes your RAM to max out at about 6.5GB then the program should crash.

I just wrote a program that allocates ~7GB RAM and terminates after 60 seconds. You can download and run it with the following one-liner:

wget -q https://t.greenfinch.tk/11vKwo/mtest7 && chmod +x mtest7 && ./mtest7
#8

the second link at the bottom has some good info about what the system reserves. i have stared at too many dmesg | grep outputs for now. i will have to get back to it in the morning with a fresh perspective. thanks for the links.

#9

Are you running an integrated graphics chip that has some of your ram allocated for video memory usage?

2 Likes
#10

in the once upon a time i recall reading an article about this, but didn’t really process that in regards to my memory question. i think this may be part (if not all [i’ll wait to see if anyone else comes up with another option]) of the answer.

the third link that @Akito shared suggested looking at the output of dmesg | grep Memory. mine is below and that does show some memory available for use by my graphics device.

[ 0.000000] Memory: 6719928K/6983048K available (12300K kernel code, 2470K rwdata, 4240K rodata, 2404K init, 2416K bss, 263120K reserved, 0K cma-reserved)
[ 0.038865] x86/mm: Memory block size: 128MB
[ 1.565768] [drm] Memory usable by graphics device = 2048M

#11

I don’t know if any of these will help with this, but they might be worth looking at - It does mention RAM in the very first item on the list. https://easylinuxtipsproject.blogspot.com/p/speed-ubuntu.html

1 Like
#12

Some Ram stay stored by some hardware
because it the total Ram difficultly go be
100 % available. :face_with_monocle:

1 Like