Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #207615

Re: Need help analyzing (kernel?) memory usage and reclaiming RAM (Debian Stretch)

From Reco <recoverym4n@enotuniq.net>
Newsgroups linux.debian.user
Subject Re: Need help analyzing (kernel?) memory usage and reclaiming RAM (Debian Stretch)
Date 2019-04-17 07:50 +0200
Message-ID <xNLCh-2oO-1@gated-at.bofh.it> (permalink)
References <xN9dD-3LR-3@gated-at.bofh.it> <xNxpD-1Z5-9@gated-at.bofh.it> <xNzrs-3bR-5@gated-at.bofh.it> <xNFwR-76n-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Apr 17, 2019 at 01:14:36AM +0200, Peter Wiersig wrote:
> Reco <recoverym4n@enotuniq.net> writes:
> 
> Hi Reco,
> 
> > On Tue, Apr 16, 2019 at 04:39:32PM +0200, Peter Wiersig wrote:
> >> VSZ is the Virtual Memory Size. (...),
> >>including memory that is swapped out,
> >> memory that is allocated, but not used,
>   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >> and memory that is from shared libraries.""
> >
> > Given this:
> >
> > == cut ==
> >
> > One can expect the process to "consume" 4Gb of VSZ, and about 700kb of
> > RSS.
> >
> > Do you really suggest to treat all this VSZ as a "used memory"? A hint -
> > compile the sample, run it a hundred times.
> 
> No, but that is all in the explanation above albeit tersely. I
> underlined the part which comes into play with your example code.

That was the whole point. If it's allocated, but ain't used - one should
not account it.


> If Martin wants to find out what's using his memory during timespans
> with degraded performance, it will not be helpful to list the processes
> and sort by thenot swapped amount.

To quote the original e-mail:

root@rad-m2m-srv02:~# free -thwl
              total        used        free      shared     buffers cache   available
Mem:           987M        910M         59M          0B        704K 16M         13M
Low:           987M        927M         59M
High:            0B          0B          0B
Swap:          2,0G        345M        1,7G
Total:         3,0G        1,2G        1,7G

root@rad-m2m-srv02:~# smem -uktr
User     Count     Swap      USS      PSS      RSS
root        39   332.8M    10.4M    12.4M    44.7M
msch         6     7.0M        0   607.0K     8.3M
_chrony      1   360.0K     4.0K    20.0K   572.0K
messagebus     1   580.0K     4.0K    17.0K   480.0K
postfix      2     1.6M        0    13.0K   568.0K
daemon       1   208.0K     4.0K     6.0K    72.0K
---------------------------------------------------
            50   342.5M    10.4M    13.0M    54.7M

A host has 1Gb of RAM and 3Gb swap.
Both "free" and "/proc/meminfo" show that there's no free memory left.
"smem" output shows us that this memory ain't used by userspace.
The question was - where all this memory has gone?


> If the system is thrashing due to swapping in and out, I always look
> at the VSZ values to find out where I should direct my attention to.

Thanks for sharing. In this particular case, swapping is a consequence,
not a root cause.
But, just in case, how exactly your method is superior to "top -o SWAP"?

Reco

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Need help analyzing (kernel?) memory usage and reclaiming RAM  (Debian Stretch) Martin Schwarz <debian-lists@alias.kuroi.de> - 2019-04-15 14:50 +0200
  Re: Need help analyzing (kernel?) memory usage and reclaiming RAM  (Debian Stretch) Reco <recoverym4n@enotuniq.net> - 2019-04-15 15:40 +0200
    Re: Need help analyzing (kernel?) memory usage and reclaiming RAM  (Debian Stretch) Martin Schwarz <debian-lists@alias.kuroi.de> - 2019-04-15 16:50 +0200
      Re: Need help analyzing (kernel?) memory usage and reclaiming RAM  (Debian Stretch) Reco <recoverym4n@enotuniq.net> - 2019-04-15 18:10 +0200
        Re: Need help analyzing (kernel?) memory usage and reclaiming RAM  (Debian Stretch) Martin Schwarz <debian-lists@alias.kuroi.de> - 2019-04-16 10:30 +0200
          Re: Need help analyzing (kernel?) memory usage and reclaiming RAM  (Debian Stretch) Reco <recoverym4n@enotuniq.net> - 2019-04-16 11:00 +0200
            Re: Need help analyzing (kernel?) memory usage and reclaiming RAM  (Debian Stretch) Martin Schwarz <debian-lists@alias.kuroi.de> - 2019-04-16 14:40 +0200
              Re: Need help analyzing (kernel?) memory usage and reclaiming RAM  (Debian Stretch) Reco <recoverym4n@enotuniq.net> - 2019-04-16 15:10 +0200
  Re: Need help analyzing (kernel?) memory usage and reclaiming RAM  (Debian Stretch) Kenneth Parker <sea7kenp@gmail.com> - 2019-04-15 16:50 +0200
    Re: Need help analyzing (kernel?) memory usage and reclaiming RAM  (Debian Stretch) Martin Schwarz <debian-lists@alias.kuroi.de> - 2019-04-15 17:10 +0200
  Re: Need help analyzing (kernel?) memory usage and reclaiming RAM (Debian Stretch) Peter Wiersig <peter@friesenpeter.de> - 2019-04-16 16:40 +0200
    Re: Need help analyzing (kernel?) memory usage and reclaiming RAM  (Debian Stretch) Reco <recoverym4n@enotuniq.net> - 2019-04-16 18:50 +0200
      Re: Need help analyzing (kernel?) memory usage and reclaiming RAM (Debian Stretch) Peter Wiersig <peter@friesenpeter.de> - 2019-04-17 01:20 +0200
        Re: Need help analyzing (kernel?) memory usage and reclaiming RAM  (Debian Stretch) Reco <recoverym4n@enotuniq.net> - 2019-04-17 07:50 +0200
    Re: Need help analyzing (kernel?) memory usage and reclaiming RAM  (Debian Stretch) Martin Schwarz <debian-lists@alias.kuroi.de> - 2019-04-17 11:40 +0200
  Re: Need help analyzing (kernel?) memory usage and reclaiming RAM (Debian Stretch) Peter Wiersig <peter@friesenpeter.de> - 2019-04-17 01:40 +0200

csiph-web