RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1253036 - 'free -b' shows incorrect value when memory is 10GB or more
Summary: 'free -b' shows incorrect value when memory is 10GB or more
Keywords:
Status: CLOSED DUPLICATE of bug 1246379
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: procps
Version: 6.7
Hardware: x86_64
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Jaromír Cápík
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-08-12 19:12 UTC by Raymond Lee
Modified: 2016-02-01 02:01 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 19:20:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Raymond Lee 2015-08-12 19:12:19 UTC
Description of problem:
The 'free -b' command is supposed to show the amount of memory in bytes.  It looks like the number is getting truncated (maybe due to formatting?) when the amount of memory is 10GB or more.  'free -t -b' also shows a truncated number for total memory.  I'm assuming that the same would be true for swap if swap is 10GB or more.  Compare the outputs below from my RHEL 6.7 server with 64GB physical memory and 4GB swap:

# free -t -g
             total       used       free     shared    buffers     cached
Mem:            62         51         11          0          0          0
-/+ buffers/cache:         50         12
Swap:            3          0          3
Total:          66         51         15


# free -t -m
             total       used       free     shared    buffers     cached
Mem:         64425      52322      12102          0         28        205
-/+ buffers/cache:      52088      12336
Swap:         3967          0       3967
Total:       68393      52322      16070


# free -t -k
             total       used       free     shared    buffers     cached
Mem:      65972116   53578248   12393868        244      28920     210720
-/+ buffers/cache:   53338608   12633508
Swap:      4063228          0    4063228
Total:    70035344   53578248   16457096


# free -t -b
             total       used       free     shared    buffers     cached
Mem:    6755544678 5486408089 1269136588     249856   29614080  215777280
-/+ buffers/cache: 5461868953 1293675724
Swap:   4160745472          0 4160745472
Total:  7171619225 5486408089 1685211136


To verify what the number in bytes should be:
# echo "`free -t -k |awk '{if ($1 == "Mem:") print $2}'` * 1024" | bc -l
67555446784




Version-Release number of selected component (if applicable):
# uname -r
2.6.32-573.1.1.el6.x86_64

# rpm -q procps
procps-3.2.8-33.el6.x86_64


How reproducible:
100%


Steps to Reproduce:
1. On a system with at least 10GB physical memory, run 'free -t -b'
2.
3.


Actual results:
(On a system with 64GB physical memory and 4GB swap)
# free -t -b
             total       used       free     shared    buffers     cached
Mem:    6755544678 5486408089 1269136588     249856   29614080  215777280
-/+ buffers/cache: 5461868953 1293675724
Swap:   4160745472          0 4160745472
Total:  7171619225 5486408089 1685211136


Expected results:
# free -t -b
             total       used       free     shared    buffers     cached
Mem:   67555446784 5486408089 1269136588     249856   29614080  215777280
-/+ buffers/cache: 5461868953 1293675724
Swap:   4160745472          0 4160745472
Total: 71716192256 5486408089 1685211136


Additional info:

Comment 2 Jaromír Cápík 2015-08-12 19:20:37 UTC
Hello Raymond.

This issue has been reported in scope of Bug 1246379 and I'm closing this as duplicate.

Thanks for the report and for your understanding.

Regards,
Jaromir.

*** This bug has been marked as a duplicate of bug 1246379 ***


Note You need to log in before you can comment on or make changes to this bug.