SIGSTOP on UNIX sistems

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
mondelob
Posts: 7
Joined: Sat Sep 02, 2017 11:34 am

SIGSTOP on UNIX sistems

Post by mondelob »

When you issue a SIGSTOP on UNIX sistems (for example, when you send the CTRL+Z command to put the program on background), the memory used by the process it's still allocated, or saves the map of this memory, to allow other process use memory?
Thank you
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: SIGSTOP on UNIX sistems

Post by Brendan »

Hi,
mondelob wrote:When you issue a SIGSTOP on UNIX sistems (for example, when you send the CTRL+Z command to put the program on background), the memory used by the process it's still allocated, or saves the map of this memory, to allow other process use memory?
SIGSTOP only pauses execution for a little while (until you send SIGCONT to make it continue again). It doesn't make sense to free any memory (and then crash when SIGCONT is sent); but might make sense to consider the process' pages "less likely to be needed soon" for the purposes of figuring out which pages to send to swap space (rather than using pure "least recently used" as the basis of what to send to swap space).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
mondelob
Posts: 7
Joined: Sat Sep 02, 2017 11:34 am

Re: SIGSTOP on UNIX sistems

Post by mondelob »

Brendan wrote:Hi,
mondelob wrote:When you issue a SIGSTOP on UNIX sistems (for example, when you send the CTRL+Z command to put the program on background), the memory used by the process it's still allocated, or saves the map of this memory, to allow other process use memory?
SIGSTOP only pauses execution for a little while (until you send SIGCONT to make it continue again). It doesn't make sense to free any memory (and then crash when SIGCONT is sent); but might make sense to consider the process' pages "less likely to be needed soon" for the purposes of figuring out which pages to send to swap space (rather than using pure "least recently used" as the basis of what to send to swap space).


Cheers,

Brendan
Thanks!
Post Reply