OOPs Concepts
Programming and Technical
What is memory leak?
Read Solution (Total 3)
-
- Memory Leak:At any moment when the pointer loses the reference of the memory block is said to be memory leak.
- 10 years agoHelpfull: Yes(1) No(0)
- when we create memory but forget to use that , this is called memory leak.
- 9 years agoHelpfull: Yes(0) No(0)
- Suppose
A *a=new B();
delete a;
The above code is in contrast to C++ language.
Whenever the object has been used but still references to that object exist then memory leakage occurs because that memory is still not deallocated. Hence this leads to memory wastage.
To avoid this make the destructor of Base class A virtual - 9 years agoHelpfull: Yes(0) No(0)
OOPs Concepts Other Question