what is the disadvantage of invoking the detection algorithm for every request?
Invoking the detection algorithm for every single request is generally a bad idea because it introduces heavy overhead in several ways.
Core disadvantage (short answer)
If you run the detection algorithm on each request, you:
- Slow the system down (extra computation every time).
- Consume more memory than necessary (algorithm data structures, bookkeeping).
- Increase latency for each request (requests spend extra time waiting while detection runs).
In typical operating‑systems questions (especially around deadlock detection), the “correct” choice is:
All of the mentioned – extra memory overhead, excessive time per request, and considerable computation time.
Mini breakdown: what’s really going wrong?
1. Computation overhead
Every detection run costs CPU cycles: building or updating data structures, traversing graphs, running checks, and evaluating conditions.
Doing that on each request means the system is constantly doing detection work instead of useful work.
- More CPU usage per unit of real work.
- Lower throughput under load.
- Potential CPU contention with other critical parts of the system.
2. Memory overhead
Detection algorithms often keep internal state: graphs (like wait‑for graphs), tables, and logs of relationships or dependencies.
Invoking them frequently can:
- Require keeping more intermediate data in memory.
- Increase cache pressure and garbage‑collection work in managed runtimes.
- Reduce memory available for user tasks or other OS components.
3. Latency and response time
If each request triggers detection before it can proceed, every request “pays” the cost:
- Requests wait longer to be allocated resources (like memory or locks).
- End‑to‑end response times grow, especially under load.
- Users or upstream systems experience slower responses, even when there is no problem (e.g., no deadlock).
A common textbook phrasing is “excessive time consumed in the request to be allocated memory” and “considerable overhead in computation time.”
Why textbooks emphasize “all of the above”
In operating‑system MCQs, the disadvantage of invoking the deadlock detection algorithm for every request is explicitly given as:
- Overhead due to memory consumption.
- Excessive time per allocation request.
- Considerable overhead in computation time.
So the correct option is “all of the mentioned,” because all three are real drawbacks when detection runs on every request.
Information gathered from public forums or data available on the internet and portrayed here.