Which of the following is a common cause of a memory leak in programming?
A
Writing comments in code
B
Using loops
C
Failing to release unused memory
D
Using too many variables
Correct Answer: Option C — Failing to release unused memory
Explanation:
A memory leak occurs when a program fails to release memory that is no longer needed, causing the application to consume increasing amounts ...
A memory leak occurs when a program fails to release memory that is no longer needed, causing the application to consume increasing amounts of memory over time. This can eventually lead to reduced performance or system crashes.