Interview Question
Country: United States
From the question If I understood correctly, the memory will never be exhausted. May be he is expecting something else.
Yes..I dont care about of out of memory because I have enough of it..so is there any reason except this, memory leak should be taken care??
Perhaps there is an issue with not being able to maintain an accurate reference count, and therefore not being able to update/write to memory or release a resource because of an inflated reference count?
May be we have enough memory but in case of memory leaks you may not get a big continuous chunk of memory that is required for an object.
It is always advisable to make a program leak free.
In my POV, If your application is a system service that run's as long as the system is ON, then memory leaks should definitely be handled. If it is a light weight (non-resource hunger) desktop application then not fixing memory leaks is acceptable.
The problem is heap gets filled with unreferenced objects probably native resource which could not be preempted causing out of memory. In a long run this might crash OS and require restart:-)
- siva October 16, 2012