– Computer Memory Leaks. Why do they happen, and what happens?

2.46K views

– Computer Memory Leaks. Why do they happen, and what happens?

In: Technology

4 Answers

Anonymous 0 Comments

The classic memory leak occurs because of a bad memory cleanup routine.

An application stores data in RAM by definition, but when it’s done with that RAM it has to release it allowing it to be used by something else.

So let’s make up an example. You have an application that has an undo option, this allows you to undo the very last thing you did in the application. But in order for this to work the application has to track the last thing you changed so it can undo it, this is stored in memory.

Now imagine the developer forgot to write the piece of code that clears the previous actions from memory, so instead of just storing the very last thing you did, it stores every single thing you’ve done since you opened the application. Even though you can only undo the very last one.

These actions keep building up in memory until there’s nothing left for other applications to use.

You are viewing 1 out of 4 answers, click here to view all answers.