|
Links: Volcanoes
What Is a Memory Leak? (Q318263)
This article discusses what memory leaks are and lists some possible causes of memory leaks. Additionally,
this article discusses the perceived memory leak and how it can be misinterpreted as a true memory leak.
Memory leaks can cause an application to run out of resources and can
cause an application to crash. It is important to track down memory
leaks. The problem of memory leaks has plagued developers in C and
C++ for years. In Microsoft Visual Studio .NET, a comprehensive garbage collection package and managed memory can stop memory leaks, but, under some circumstances, a program may appear to be leaking memory.
A memory leak occurs when memory is allocated in a program and
is never returned to the operating system, even though the program
does not use the memory any longer. The following are the four basic
types of memory leaks: In a manually managed memory environment:
Memory is dynamically allocated and referenced by a pointer.
The pointer is erased before the memory is freed. After the
pointer is erased, the memory can no longer be accessed and
therefore cannot be freed.
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30
31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40
41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50
51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 |
61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 |
71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80
81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90
91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 |