memory leak occurs?

I just want to know what will happen if memory leak occurs??
Last edited on
If ur program deals with huge amounts of data, it can be a serious problem.
1
2
3
4
5
6
7

int main()
{
int* i=new int[10];
// do something
//end without deleting the memory assingned to i
}

Abstract Memory leak:
1) the os assumes that this block is being used to store something, but actually its of no further use.
2)This block of memory will not be used for any other purpose.
2) After a long time the OS realises, that the memory block is not being used, then it frees it and makes it available as free memory.

There is something called as Garbage Collector which does it periodically.
Thanks.
I should find how the os finds available memory block.

Os is a very interesting subject, explore it.
Topic archived. No new replies allowed.