why certain apps can freeze the entire OS? If processes alternate each other by scheduler, then why computer freezes? Why it happens? How can a program/app have this “power” to do it? What are the most common reasons? Is there a way to unfreeze it? If I wait a lot, will it eventually unfreeze?

239 views

You can answer in technical ways (even though the sub says the opposite) if you want. I should understand it.

In: 3

6 Answers

Anonymous 0 Comments

1. It could be due to deadlock. Multiple app processes wait on each other to release some resource, but wait forever for an event that will never occur. For example: processes A and B require resources 1 and 2 in order to complete some operation. Process A holds resource 1, process B holds resource 2. Process A attempts to acquire resource 2, but since process B already holds it, process A waits until process B is done with it. And likewise for process B and resource 1. They both wait indefinitely.

2. It may be due to the virtual memory manager swapping blocks of data in and out of main memory excessively. When your system runs low on available RAM, it transfers data from infrequently used regions of memory to the hard drive. This effectively increases the amount of memory your system has and frees up that RAM for use. When the data that was swapped out needs to be used again, it can be moved back into main memory. However, hard drive speeds are extremely slow when compared to RAM speeds. If all of a program’s needed code and data has been swapped out, it has no choice but to wait until it’s swapped in again. But this can be true for multiple programs, and swapping one block of data into memory means swapping another block of data out of memory. It’s possible that more processor time is spent swapping data in and out of memory than executing program code.

3. Freezes can be caused by a condition known as starvation. Operating systems give each app a priority level. Apps with higher priority always run before apps of lower priorities. Some misbehaving apps can hog all of the processor time for itself, preventing low priority apps from running. Or, a high priority app may need to wait for a low priority app, but the low priority app never runs because it’s being starved.

Most operating systems today use techniques to handle these problems, but there’s no perfect solution. In general, there’s no way to know whether an app will unfreeze if you wait long enough.

You are viewing 1 out of 6 answers, click here to view all answers.