GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Programming  >  C++

 Print  |  
Question:  What is a memory leak? How can we avoid it?



July 07, 2006 21:48:22 #1
 Sabith   Member Since: Visitor    Total Comments: N/A 

RE: What is a memory leak? How can we avoid it?
 
In computer science, a memory leak is a particular kind of unintentional memory consumption by a computer program where the program fails to release memory when no longer needed. The term is meant as a humorous misnomer, since memory is not physically lost from the computer, but rather becomes claimed but ignored due to program logic flaws. When we are allocating memory using new or malloc and then failing to deallocate the memory after its use within the application's life span, then the memory allocated earlier will become unusable for the application, there by making it a leak in the memory.
     

 

Back To Question