On 02/12/2018 11:36, Ralph Corderoy wrote:
Hi Tim,

      while sleep 50; do date -Is; swapon -s; done >swap.log
Nice, but I'd use:

        while sleep 50; do swapon -s | logger -t checkswap
...
$ sudo grep checkswap /var/log/messages
Ok stupid question time, I assume I just enter

"while sleep 50; do swapon -s | logger -t checkswap" (without the speech marks)
No, it needs a `done', e.g.

     while sleep 50; do swapon -s | logger -t checkswap; done

sudo grep checkswap /var/log/messages
Well, that depends on where those log messages end up.  If it's in
/var/log/messages then yes.  Here, I don't have that file.  Being a
systemd Linux means I need to use journalctl(1), as I mentioned before.
Writing to your own local `swap.log' in a temporary directory avoids
this problem, and also doesn't clutter the main logs with swapon's
output every fifty seconds when you've got a time-stamp to investigate.

Assuming that is correct it has not shown me anything.
Without the `done', the shell's prompt will change, e.g. from `$ ' to
`> ', and it will await from input before even running swapon(8) the
first time.

Came to my PC this morning, completely locked up, hard disk light was
going mad and it took around 5 minutes to show me a desktop. I did try
to ssh in but that just sat there  and only allowed me to login once
the PC had sorted its self out and was showing the desktop.
Classic signs of high swap-space use.  Overnight, something had wanted
more and more memory.  Everything else got pushed out to slow (spinning
rust?) swap.  You turn up and waggle the mouse and all that pushed out
stuff fights to get pull back in.  If you're `lucky' then the memory hog
gets pushed out instead.

The quickest way of getting a login, e.g. to `killall firefox', is to
Ctrl-Alt-F1, or F2, to get to a Virtual Terminal's login prompt;  no
graphics.  Alt-F7, or F8, will return to your graphic VT.

Tonight I will close both browser down, I have not done that yet as I
have been adjusting things. I think what is happening is that swap
disappears and then one of both browsers crash as the data they want
is in the swap file that has crashed. Still no nearer knowing why swap
is stopping.
If swap had disappeared this morning then there wouldn't have been a
delay in the desktop being responsive.  The main suspects in a memory
leak that causes memory to be used up over time on your system are the
browsers.

Cheers, Ralph.

OK I changed my the command to

 while sleep 50; do swapon -s | logger -t checkswap; done >/home/mit/swap.log

The file has been made in my home folder so I will keep an eye on it.

In light on my other post (about the script), hopefully I have found the issue but there is plenty here for me to continue chasing the issue if it persists.

Thanks guys

Tim



--
 Next meeting at *new* venue:  Bournemouth, Tuesday, 2018-12-04 20:00
 Check if you're replying to the list or the author
 Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk/
 New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk

Reply via email to