Score:0

How do I interpret the +1 offset in free -m on Linux terminal console?

hn flag

Well, I made a mistake with my first post of this question and I'm pretty sure that I've figured this problem out; however, I love to get feedback from other programmers who may have more direct expertise with issues.

I landed on this page because I am researching the best descriptive methods for explaining the output that sudo free -m command displays in the Ubuntu/Linux terminal. I have a problem with interpreting this output free -m on Ubuntu/Linux terminal console.

The rows and columns are self-explanatory enough for the most part; however, what is irritating me is that in every example that I analyzed the free = used(memory) - total- buffer - cache and the used = total - free - buffer - cache; the result is always offset by +1 megabyte greater than the system report for free (memory).

This is due to the indexing memory addresses where the counts begin at 0, right? Or is it a swap issue, an availability issue, or just some anomaly that is treated as negligible?

user10489 avatar
in flag
It is not necessary to use sudo to run free.
user19000691 avatar
hn flag
Yes, I am aware of this fact. :) Thank you for noting it but this is for an Operating System Architecture course; the use of 'sudo' is mostly demonstrative, as sudo is the superuser and/or system administrative (BSD System Manager's) command that shows that we are aware of how to handle administrative tasks.
user10489 avatar
in flag
Excessive use of sudo is a very bad habit. When it becomes reflexive to just prefix everything with sudo, you will eventually run something that will break things when it would have been fine in a user context. Saying "but this is for a class" makes it worse, because now you are using bad examples to teach.
Score:1
in flag

The -m option of free rounds the numbers to 1M. So the discrepancy is almost certainly round off error. Recheck the numbers without -m

user19000691 avatar
hn flag
Thank you user10489; that definitely clarified the problem. I am going to reference your comment in my paper BTW...
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.