On Sat, Nov 14, 2020 at 12:21:30PM +0200, Mihai Popescu wrote:

> On Sat, Nov 14, 2020 at 9:29 AM Otto Moerbeek <[email protected]> wrote:
> 
> >
> >
> > vmstat only swows pi an po, pages paged in and out, not swap usage.
> >
> > For sysyat: the vmstat view does not show swap usage, but it does show
> > paging/swap traffic. The swap view does (per swap device), as does the
> > uvm view (swpginuse, this is a total swap pages in use).
> >
> > top also shows swap usage.
> >
> >         -Otto
> >
> 
> I know, but what I am trying to say is I don't know how to compute a "big
> total" memory usage needed before hitting swap. No matter how I add, the
> final number is not in the line with the dmesg reported memory. Here is top:
> 
> $ top
> load averages:  0.33,  0.23,  0.10                    thinkc.my.domain
> 12:20:39
> 47 processes: 46 idle, 1 on processor                                  up
>  4:17
> CPU0: 22.4% user,  0.0% nice,  3.8% sys,  0.6% spin,  0.6% intr, 72.7% idle
> CPU1: 21.2% user,  0.0% nice,  3.0% sys,  0.2% spin,  0.0% intr, 75.6% idle
> Memory: Real: 1235M/2914M act/tot Free: 4505M Cache: 1054M Swap: 0K/7913M

Cutting some corners, but the basics go like this:

Currently, no swap is used.

You see 4505G is free. Roughly you can use that amount more. If free
becomes low, cache will be reduced and/or pages swapped out, making
more pages free so they can become used and part of tot.

tot + free + cache should add up to available RAM (which is a bit less
than what you have in the machine, since the kernel also needs to fit
somewhere and uses memory of its own).

        -Otto

Reply via email to