Question 86
In memory management, what causes a 'Memory Leak'?
Memory leaks occur when dynamically allocated heap chunks become unreachable before being deallocated.
In memory management, what causes a 'Memory Leak'?
Memory leaks occur when dynamically allocated heap chunks become unreachable before being deallocated.
Which Garbage Collection algorithm periodically traces all reachable heap objects starting from root pointers and reclaims unmarked objects?
Mark-and-Sweep runs in two phases: 1) Mark phase traverses graph from roots; 2) Sweep phase frees unmarked memory nodes.
What major limitation affects simple 'Reference Counting' garbage collection systems?
Reference counting fails when objects reference each other in a closed cycle because non-zero count prevents reclamation.
Which parameter-passing model evaluates actual parameter expressions into thunks and defers their evaluation until the parameter is referenced?
The model described is call-by-name, but it is absent from A-C and D is not a parameter-passing model. Therefore none of A-D matches the description.
Which parameter passing style copies actual argument values into formal parameters at call time, and copies final modified parameter values back upon function return?
Call-by-Value-Result copies parameters in upon entering the function and copies altered local parameter results back out on return.