In the past, I developed a few useful tools for detecting memory leaks caused by linux kernel modules.
In this post, I will go over the basics of a memory leak and the impact/consequences of a memory leak on an embedded system.
Basics
Here is a sample C program that allocates a character array, but doesn't free it:
Memory Leak Consequences
A memory leak in a rarely executed code path may not be a serious issue.
However, when frequently executed code paths leak memory over a period of time continuously, memory available to the system goes down and hence memory leak can be harmful. Memory leaks can cause software:
- to perform poorly by reducing the amount of memory available in the system
- to malfunction due to memory allocation errors
- to eventually bring down the entire system
No comments:
Post a Comment