Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 451048 - Have emerge --info report available RAM
Summary: Have emerge --info report available RAM
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Enhancement/Feature Requests (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 445274
  Show dependency tree
 
Reported: 2013-01-09 13:32 UTC by Jeroen Roovers (RETIRED)
Modified: 2013-01-17 18:27 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roovers (RETIRED) gentoo-dev 2013-01-09 13:32:03 UTC
In bug reports it is sometimes useful to know how much available memory the host has. This is especially useful in bug reports detailing ICEs, since GCC does not always deal with memory allocation properly.

So why don't we have `emerge --info' tell us what RAM is available?
Comment 1 Zac Medico gentoo-dev 2013-01-09 14:09:54 UTC
I guess we could parse the output of `free`. Maybe we should show the total amount of swap too.
Comment 2 Zac Medico gentoo-dev 2013-01-16 14:14:22 UTC
This is fixed in git:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9a3a82fda113008b877c0447e1d6a8780365ab98

Output is formatted similarly to top:

KiB Mem:     8110136 total,   1115784 free
KiB Swap:    8388604 total,   8311120 free
Comment 3 Zac Medico gentoo-dev 2013-01-16 15:07:50 UTC
This is fixed in 2.1.11.43 and 2.2.0_alpha154.
Comment 4 Andrew Church 2013-01-16 20:49:28 UTC
JFYI, as implemented this excludes buffers/cache from "free" memory:

$ emerge --info
[...]
KiB Mem:     8308588 total,   1079652 free
KiB Swap:    4193276 total,   3896084 free
[...]
$ free
             total       used       free     shared    buffers     cached
Mem:       8308588    7199116    1109472          0     476892    6028944
-/+ buffers/cache:     693280    7615308
Swap:      4193276     297192    3896084

Depending on how you intend to use it, it might be more useful to include buffers/cache in free memory (second line) since they'll be discarded if memory pressure increases.
Comment 5 Zac Medico gentoo-dev 2013-01-17 18:27:10 UTC
(In reply to comment #4)
> Depending on how you intend to use it, it might be more useful to include
> buffers/cache in free memory (second line) since they'll be discarded if
> memory pressure increases.

If the current behavior is insufficient, I'd suggest to extend it to contain more fields, like the `top` command does:

KiB Mem:   8110136 total,  7909268 used,   200868 free,    28468 buffers
KiB Swap:  8388604 total,   111044 used,  8277560 free,  6117808 cached