Why are these using swap when I have plenty of free ram?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Why are these using swap when I have plenty of free ram?

Chris-4
The below processes are using swap for some reason:

User     Name                         Swap
root     courierlogger                  76
daemon   atd                           188
root     acpid                         116
avahi    avahi-daemon                  300
root     lvmetad                       208
root     authdaemond                    12
root     osspd                         124
root     cron                          184
root     wpa_supplicant                480
systemd-timesync systemd-timesy        460
systemd-resolve systemd-resolv         492
root     irqbalance                     44
avahi    avahi-daemon                  220
root     systemd-logind                424
root     smartd                        564
root     accounts-daemon               312
syslog   rsyslogd                      404
gdm      (sd-pam                      1440
root     systemd-udevd                1036
messagebus dbus-daemon                 252
chris    (sd-pam                       188
root     systemd                       196
root     networkd-dispat              3344
root     udisksd                       252
root     systemd-journal               340
 
 total        used        free      shared  buff/cache   available
Mem15351148  6475100     3012432    407808   5863616     5408332
Swap:       4089852       53248     4036604

Before anyone asks I've had a swap partition for years dating way back
so I've just never removed it. It's only been a month or so that swap
has started being used and I have no idea why with plenty of free ram.
Of course it's not hurting anything however I'm really curious as to
why these processes are using it. Ubuntu version and kernel version are
in my sig.

--
Chris
31.11972; -97.90167 (Elev. 1092 ft)
15:32:17 up 9 days, 1:10, 1 user, load average: 0.72, 1.09, 0.92
Description: Ubuntu 18.04.3 LTS, kernel 5.0.0-32-generic


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Why are these using swap when I have plenty of free ram?

Robert Heller
At Fri, 08 Nov 2019 15:42:18 -0600 "Ubuntu user technical support,  not for general discussions" <[hidden email]> wrote:

>
> The below processes are using swap for some reason:
>
> User     Name                         Swap
> root     courierlogger                  76
> daemon   atd                           188
> root     acpid                         116
> avahi    avahi-daemon                  300
> root     lvmetad                       208
> root     authdaemond                    12
> root     osspd                         124
> root     cron                          184
> root     wpa_supplicant                480
> systemd-timesync systemd-timesy        460
> systemd-resolve systemd-resolv         492
> root     irqbalance                     44
> avahi    avahi-daemon                  220
> root     systemd-logind                424
> root     smartd                        564
> root     accounts-daemon               312
> syslog   rsyslogd                      404
> gdm      (sd-pam                      1440
> root     systemd-udevd                1036
> messagebus dbus-daemon                 252
> chris    (sd-pam                       188
> root     systemd                       196
> root     networkd-dispat              3344
> root     udisksd                       252
> root     systemd-journal               340
>  
>  total        used        free      shared  buff/cache   available
> Mem15351148  6475100     3012432    407808   5863616     5408332
> Swap:       4089852       53248     4036604
>
> Before anyone asks I've had a swap partition for years dating way back
> so I've just never removed it. It's only been a month or so that swap
> has started being used and I have no idea why with plenty of free ram.
> Of course it's not hurting anything however I'm really curious as to
> why these processes are using it. Ubuntu version and kernel version are
> in my sig.

The kernel will move "unused" portions of process memory to swap from time to
time, usually because the process memory has had no access in a low while.  
This partitularly happens when memory becomes "tight" (too little free RAM).

>

--
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
[hidden email]       -- Webhosting Services
                                                                                                                           

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Why are these using swap when I have plenty of free ram?

Colin Law
In reply to this post by Chris-4
On Fri, 8 Nov 2019 at 21:44, Chris <[hidden email]> wrote:
>
> The below processes are using swap for some reason:

If you have a transient situation with a shortage of RAM then little
used stuff will be moved out to swap. When the transient situation is
over there may be plenty of RAM available but if the stuff in swap is
not used again then it will be left there.  There is no reason to go
to the effort of moving it back.

Colin

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Why are these using swap when I have plenty of free ram?

Chris-4
On Fri, 2019-11-08 at 22:19 +0000, Colin Law wrote:

> On Fri, 8 Nov 2019 at 21:44, Chris <[hidden email]>
> wrote:
> >
> > The below processes are using swap for some reason:
>
> If you have a transient situation with a shortage of RAM then little
> used stuff will be moved out to swap. When the transient situation is
> over there may be plenty of RAM available but if the stuff in swap is
> not used again then it will be left there.  There is no reason to go
> to the effort of moving it back.
>
> Colin
>
Thanks Colin and Robert for the explanations. Seems to have just
started with the current kernel version. No biggie then.

Thanks again
Chris

--
Chris
31.11972; -97.90167 (Elev. 1092 ft)
16:50:21 up 9 days, 2:28, 1 user, load average: 0.72, 0.51, 0.48
Description: Ubuntu 18.04.3 LTS, kernel 5.0.0-32-generic


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Why are these using swap when I have plenty of free ram?

Colin Watson
In reply to this post by Colin Law
On Fri, Nov 08, 2019 at 10:19:15PM +0000, Colin Law wrote:
> On Fri, 8 Nov 2019 at 21:44, Chris <[hidden email]> wrote:
> > The below processes are using swap for some reason:
>
> If you have a transient situation with a shortage of RAM then little
> used stuff will be moved out to swap. When the transient situation is
> over there may be plenty of RAM available but if the stuff in swap is
> not used again then it will be left there.  There is no reason to go
> to the effort of moving it back.

In a similar way, it might even be not because of any particular memory
pressure, but because using RAM to cache things read from disk was more
valuable than keeping the memory of rarely-used processes in RAM.

--
Colin Watson                                       [[hidden email]]

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Why are these using swap when I have plenty of free ram?

Chris-4
On Sat, 2019-11-09 at 01:11 +0000, Colin Watson wrote:

> On Fri, Nov 08, 2019 at 10:19:15PM +0000, Colin Law wrote:
> > On Fri, 8 Nov 2019 at 21:44, Chris <[hidden email]>
> > wrote:
> > > The below processes are using swap for some reason:
> >
> > If you have a transient situation with a shortage of RAM then
> > little
> > used stuff will be moved out to swap. When the transient situation
> > is
> > over there may be plenty of RAM available but if the stuff in swap
> > is
> > not used again then it will be left there.  There is no reason to
> > go
> > to the effort of moving it back.
>
> In a similar way, it might even be not because of any particular
> memory
> pressure, but because using RAM to cache things read from disk was
> more
> valuable than keeping the memory of rarely-used processes in RAM.
>
> --
> Colin Watson                                       [
> [hidden email]]
>
Thanks Colin however one process
syslog   rsyslogd                      404
to me doesn't seem like a rarely used process. I'm sure there may be
others however that just stands out to me.

--
Chris
31.11972; -97.90167 (Elev. 1092 ft)
19:36:01 up 9 days, 5:14, 1 user, load average: 1.24, 0.97, 0.75
Description: Ubuntu 18.04.3 LTS, kernel 5.0.0-32-generic


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Why are these using swap when I have plenty of free ram?

Robert Heller
At Fri, 08 Nov 2019 19:36:53 -0600 "Ubuntu user technical support,  not for general discussions" <[hidden email]> wrote:

>
> On Sat, 2019-11-09 at 01:11 +0000, Colin Watson wrote:
> > On Fri, Nov 08, 2019 at 10:19:15PM +0000, Colin Law wrote:
> > > On Fri, 8 Nov 2019 at 21:44, Chris <[hidden email]>
> > > wrote:
> > > > The below processes are using swap for some reason:
> > >
> > > If you have a transient situation with a shortage of RAM then
> > > little
> > > used stuff will be moved out to swap. When the transient situation
> > > is
> > > over there may be plenty of RAM available but if the stuff in swap
> > > is
> > > not used again then it will be left there.  There is no reason to
> > > go
> > > to the effort of moving it back.
> >
> > In a similar way, it might even be not because of any particular
> > memory
> > pressure, but because using RAM to cache things read from disk was
> > more
> > valuable than keeping the memory of rarely-used processes in RAM.
> >
> > --
> > Colin Watson                                       [
> > [hidden email]]
> >
> Thanks Colin however one process
> syslog   rsyslogd                      404
> to me doesn't seem like a rarely used process. I'm sure there may be
> others however that just stands out to me.
>

Some *parts* of rsyslogd are not used much.  Those parts might get swapped
out.  The swapper does not swap the whole process, only those pages not being
used.



--
Robert Heller             -- 978-544-6933
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
[hidden email]       -- Webhosting Services

--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
Reply | Threaded
Open this post in threaded view
|

Re: Why are these using swap when I have plenty of free ram?

Chris-4
On Fri, 2019-11-08 at 21:06 -0500, Robert Heller wrote:

> At Fri, 08 Nov 2019 19:36:53 -0600 "Ubuntu user technical
> support,  not for general discussions" <[hidden email]
> > wrote:
>
> >
> > On Sat, 2019-11-09 at 01:11 +0000, Colin Watson wrote:
> > > On Fri, Nov 08, 2019 at 10:19:15PM +0000, Colin Law wrote:
> > > > On Fri, 8 Nov 2019 at 21:44, Chris <[hidden email]
> > > > >
> > > > wrote:
> > > > > The below processes are using swap for some reason:
> > > >
> > > > If you have a transient situation with a shortage of RAM then
> > > > little
> > > > used stuff will be moved out to swap. When the transient
> > > > situation
> > > > is
> > > > over there may be plenty of RAM available but if the stuff in
> > > > swap
> > > > is
> > > > not used again then it will be left there.  There is no reason
> > > > to
> > > > go
> > > > to the effort of moving it back.
> > >
> > > In a similar way, it might even be not because of any particular
> > > memory
> > > pressure, but because using RAM to cache things read from disk
> > > was
> > > more
> > > valuable than keeping the memory of rarely-used processes in RAM.
> > >
> > > --
> > > Colin Watson                                       [
> > > [hidden email]]
> > >
> >
> > Thanks Colin however one process
> > syslog   rsyslogd                      404
> > to me doesn't seem like a rarely used process. I'm sure there may
> > be
> > others however that just stands out to me.
> >
>
> Some *parts* of rsyslogd are not used much.  Those parts might get
> swapped
> out.  The swapper does not swap the whole process, only those pages
> not being
> used.
>
Thanks Robert, didn't realize that. Appreciate the info.

>
> --
> Robert Heller             -- 978-544-6933
> Deepwoods Software        -- Custom Software Services
> http://www.deepsoft.com/om/  -- Linux Administration Services
> [hidden email]       -- Webhosting Services
>

--
Chris
31.11972; -97.90167 (Elev. 1092 ft)
20:18:25 up 9 days, 5:56, 1 user, load average: 0.80, 0.51, 0.56
Description: Ubuntu 18.04.3 LTS, kernel 5.0.0-32-generic


--
ubuntu-users mailing list
[hidden email]
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users