awiebe
awiebe

Reputation: 3846

Does unix page out stopped processes?

If I send a process SIGSTOP by default the process will cease taking clock cycles, however it does not seem to unload itself from real memory. Does this behavior vary by implementation, or is there a way to force a process to page out? I use BSD Unix(Mac OS).

Upvotes: 1

Views: 159

Answers (1)

bdonlan
bdonlan

Reputation: 231293

While I can't speak about mac os specifically, usually Unix-based OSes won't instantly page out upon SIGSTOP. There are a few reasons for this:

  1. Paging out requires I/O bandwidth; using up I/O bandwidth needlessly might actually slow your computer down.
  2. Often processes aren't stopped very long; particularly if you're debugging! For all the OS knows you'll resume it before it even finishes paging out.
  3. There's no real need to force-page-out. Over time, if there actually is memory pressure, unused data will be paged out, eventually.

Upvotes: 3

Related Questions