As a default, Line 1 reflects \*(MP, classified as:
.nf
- total, used, free and buffers
+ total, free, used and buff/cache
.fi
Line 2 reflects mostly \*(MV, classified as:
.nf
- total, used, free and cached (which is \*(MP)
+ total, free, used and avail (which is \*(MP)
.fi
+The \fBavail\fR number on line 2 is an estimation of \*(MP available for
+starting new applications, without swapping.
+Unlike the \fBfree\fR field, it attempts to account for readily reclaimable
+page cache and memory slabs.
+It is available on kernels 3.14, emulated on kernels 2.6.27+ and displayed
+as zero otherwise.
+
In the alternate memory display modes, two abbreviated summary lines
are shown consisting of these elements:
.nf
Where: a) is the percentage used; b) is the total available; and c) is one of two
visual graphs of those representations.
-In the case of \*(MP, the percentage includes the sum of \fBused\fR, \fBbuffers\fR
-and \fBcached\fR memory noted above.
-The `Mem' graph itself is divided between \fBused\fR then \fBbuffers\fR and \fBcached\fR combined.
+In the case of \*(MP, the percentage represents the \fBtotal\fR minus the estimated
+\fBavail\fR noted above.
+The `Mem' graph itself is divided between \fBused\fR the any remaining memory not
+otherwise accounted for by \fBavail\fR.
\*(XT 4b. SUMMARY AREA Commands and the `m' command for additional information
on that special 4-way toggle.
// and prT macro might replace space at buf[8] with: ------> +
char buf[10]; // MEMORY_lines_fmt provides for 8+1 bytes
} buftab[8];
- unsigned long kb_main_my_used;
+ unsigned long kb_main_my_used, kb_main_my_misc;
if (!scaletab[0].label) {
scaletab[0].label = N_txt(AMT_kilobyte_txt);
scaletab[4].label = N_txt(AMT_petabyte_txt);
scaletab[5].label = N_txt(AMT_exxabyte_txt);
}
- kb_main_my_used = kb_main_used - kb_main_buffers - kb_main_cached;
+ kb_main_my_misc = kb_main_buffers + kb_main_cached;
+ kb_main_my_used = kb_main_used - kb_main_my_misc;
if (w->rc.graph_mems) {
static struct {
char used[SMLBUFSIZ], util[SMLBUFSIZ], dual[MEDBUFSIZ];
int ix = w->rc.graph_mems - 1;
float pct_used = (float)kb_main_my_used * (100.0 / (float)kb_main_total),
- pct_misc = (float)(kb_main_buffers + kb_main_cached) * (100.0 / (float)kb_main_total),
+#ifdef MEMGRAPH_OLD
+ pct_misc = (float)kb_main_my_misc * (100.0 / (float)kb_main_total),
+#else
+ pct_misc = (float)(kb_main_total - kb_main_available - kb_main_my_used) * (100.0 / (float)kb_main_total),
+#endif
pct_swap = kb_swap_total ? (float)kb_swap_used * (100.0 / (float)kb_swap_total) : 0;
snprintf(used, sizeof(used), gtab[ix].used, (int)((pct_used * Graph_adj) + .5), gtab[ix].type);
snprintf(util, sizeof(util), gtab[ix].misc, (int)((pct_misc * Graph_adj) + .5), gtab[ix].type);
, scT(label), N_txt(WORD_abv_swp_txt), pct_swap, bfT(1), Graph_len +2, Graph_len +2, util));
} else {
prT(bfT(0), mkM(total)); prT(bfT(1), mkM(free));
- prT(bfT(2), mkM(my_used)); prT(bfT(3), mkM(buffers));
+ prT(bfT(2), mkM(my_used)); prT(bfT(3), mkM(my_misc));
prT(bfT(4), mkS(total)); prT(bfT(5), mkS(free));
- prT(bfT(6), mkS(used)); prT(bfT(7), mkM(cached));
+ prT(bfT(6), mkS(used)); prT(bfT(7), mkM(available));
show_special(0, fmtmk(N_unq(MEMORY_lines_fmt)
, scT(label), N_txt(WORD_abv_mem_txt), bfT(0), bfT(1), bfT(2), bfT(3)
, scT(label), N_txt(WORD_abv_swp_txt), bfT(4), bfT(5), bfT(6), bfT(7)
//#define INSP_OFFDEMO /* disable demo screens, issue msg instead */
//#define INSP_SAVEBUF /* preserve 'Insp_buf' contents in a file */
//#define INSP_SLIDE_1 /* when scrolling left/right don't move 8 */
+//#define MEMGRAPH_OLD /* don't use 'available' when graphing Mem */
//#define OFF_HST_HASH /* use BOTH qsort+bsrch vs. hashing scheme */
//#define OFF_NUMASKIP /* do NOT skip numa nodes if discontinuous */
//#define OFF_SCROLLBK /* disable tty emulators scrollback buffer */
#if defined(TERMIOS_ONLY)
# warning 'TERMIOS_ONLY' disables input recall and makes man doc incorrect
#endif
+#if defined(MEMGRAPH_OLD)
+# warning 'MEMGRAPH_OLD' will make the man document Section 2c. misleading
+#endif
/*###### Some Prototypes (ha!) #########################################*/
"%#5.1f ~2us,~3%#5.1f ~2sy,~3%#5.1f ~2ni,~3%#5.1f ~2id,~3%#5.1f ~2wa,~3%#5.1f ~2hi,~3%#5.1f ~2si,~3%#5.1f ~2st~3\n");
Uniq_nlstab[MEMORY_lines_fmt] = _(""
- "%s %s:~3 %9.9s~2total,~3 %9.9s~2free,~3 %9.9s~2used,~3 %9.9s~2buffers~3\n"
- "%s %s:~3 %9.9s~2total,~3 %9.9s~2free,~3 %9.9s~2used.~3 %9.9s~2cached %s~3\n");
+ "%s %s:~3 %9.9s~2total,~3 %9.9s~2free,~3 %9.9s~2used,~3 %9.9s~2buff/cache~3\n"
+ "%s %s:~3 %9.9s~2total,~3 %9.9s~2free,~3 %9.9s~2used.~3 %9.9s~2avail %s~3\n");
Uniq_nlstab[INSP_hdrsels_fmt] = _(""
"Inspection~2 Pause at: pid ~1%d~6 running ~1%s~6 as user ~1%s~6\n"