[ale] Ram, sigstop, swap, pids, etc
Steve Litt
slitt at troubleshooters.com
Mon Feb 8 19:43:29 EST 2021
On Mon, 08 Feb 2021 14:13:55 -0500
Jim Kinney via Ale <ale at ale.org> wrote:
> I want to send Bob's job a SIGSTOP and let Mary's job run to
> completion. Then send a SIGCONT and Bob is back running.
I just created a 2.7GB text file, called junk.jnk, that has 293 million
lines. I ran gkrellm and then ran the following:
sort junk.jnk
kill -SIGSTOP 18665
CPU usage immediately dropped from 66% to about 2%. A few seconds later
I did:
kill -SIGCONT 18665
CPU usage went back up to 66%. So based on that, it seems like the
STOP/CONT combination works well. I think Bob's job would eventually
swap out. If you REALLY want to swap it out quickly, you could write a
C program that does nothing but malloc() and copy bogus bytes to the
newly allocated pointers (because without the bogus bytes, you don't
really consume RAM). Have it malloc() about the same amount of RAM as
you expect Mary's process will need. Then free() it all and exit. I
suspect this quick program would cause Bob's stopped program to swap,
leaving the path clear for Mary's program to run.
SteveT
Steve Litt
Autumn 2020 featured book: Thriving in Tough Times
http://www.troubleshooters.com/thrive
More information about the Ale
mailing list