Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   Incorrect reporting of memory installed on system by "free"? (http://www.linux-archive.org/debian-user/319417-incorrect-reporting-memory-installed-system-free.html)

James Zuelow 02-02-2010 06:03 PM

Incorrect reporting of memory installed on system by "free"?
 
> -----Original Message-----
> From: Tech Geek [mailto:techgeek12345@gmail.com]
> Sent: Tuesday, 02 February, 2010 09:18
> To: debian-user@lists.debian.org
> Subject: Incorrect reporting of memory installed on system by "free"?
>
> So I know my system has 2 GB Memory.
>
( snip )

> debian:~# free -k
> total used free shared
> buffers cached
> Mem: 2063496 2033428 30068 0
> 396828 744344
> -/+ buffers/cache: 892256 1171240
> Swap: 3903752 58444 3845308
>
> debian:~# free -m
> total used free shared
> buffers cached
> Mem: 2015 1985 29 0
> 387 726
> -/+ buffers/cache: 871 1143
> Swap: 3812 57 3755
>
> So far everything looks good. However when I try to report
> the memory in GBs, I get:
>
> debian:~# free -g
> total used free shared
> buffers cached
> Mem: 1 1 0 0
> 0 0
> -/+ buffers/cache: 0 1
> Swap: 3 0 3
>
> It just shows that there is just 1 GB of memory installed in
> total. Am I missing something? Should I file a bug report?
>
> Thanks
>
Don't file a bug, it is expected behavior. It is using integers.

Some of your physical RAM is being used for video, the kernel, whatever. So it is not available to your system. That's why it is reporting 2015MB instead of the expected 2048MB for 2GB.

( 2015 / 1024 ) = 1.96GB, which is what you are expecting.

But Int( 2015 / 1024 ) = 1, which is what you are seeing.

You can see this in a bash shell:

$ let x="(( 2015 / 1024 ))"
$ echo $x
$ 1

James Zuelow
Network Specialist
City and Borough of Juneau MIS (907)586-0236

--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


All times are GMT. The time now is 08:00 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.