2
$\begingroup$

I am currently writing from a computer on which a VM has just frozen due to exhausted RAM. I am obviously no expert in the field of operating systems but i know that they implement certain memory management methods so why can't my OS handle my alt-f4 request to kill the troublesome process in a reasonable time?

Why can't other processess still run normally?

Shouldn't operating system swap between active tasks so that my keyboard input reaches said process?

Operating system in itself should be of top priority with handling user input isn't that right?

Therefore my question remains: how come, despite all the round-robin and/or other scheduling mechanics my OS still freezes?

Thank You for all the answers. Cheers.

$\endgroup$

2 Answers 2

2
$\begingroup$

A "system freeze" is normally due to the system running out of some resource and spending it's limited resources left trying frantically to fix up the mess. I.e., too much CPU load, has no processing power left for the user. Memory overload, keeps trying to free memory and gets nowhere, no time left for the user (and no memory to load programs).

It might also be a deadlock (some tasks inside the system are holding resources others require, and are waiting for still others to be released, but that will never happen as everybody is waiting for somebody else's resources).

$\endgroup$
1
  • $\begingroup$ I think it's also worth mentioning that OSes "freeze" because they are not real-time systems. They will handle user's input eventually, but there's no bound on how long you must wait. $\endgroup$ Commented Jun 15, 2021 at 8:53
1
$\begingroup$

Therefore my question remains: how come, despite all the round-robin and/or other scheduling mechanics my OS still freezes?

Despite all the scheduling algorithms,the real world scenario is different. The freeze can be seen as a result of resource exhaustion. Since the RAM is limited, OS then uses swapping but it causes thrashing also. Resources necessary for some part of the system to run are not available, due to being in use by other processes or simply insufficient.

Modern OS use pre-emptive multitasking.In these cases, a single thread getting stuck will not necessarily hang the system, it will be preempted when its time slice (time quantum)expires, allowing another thread to run. If a thread does hang, the scheduler may switch to another group of interdependent tasks so that all processes will not hang.However, thread which is stuck will still consume resources: at least an entry in scheduling, and if it is running (for instance, stuck in an infinite loop), it will consume processor cycles and power when it is scheduled, slowing the system further.

However, even with preemptive multitasking, a system can hang, and a misbehaved or malicious task can hang the system, primarily by monopolizing some other resource, such as IO or memory, even though processor time can't be monopolized.

Analyzing the Ubuntu using system monitor, I can say that often processes that blocks the file system will often hang the system. But there are many factors leading to it. It can also driver issues or some hardware malfunctioning. These all can cause the system to slow down.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.