Question

I use linux command top to observe a program running and I can see increasing memory used by that program.

How to figure out that symptom is caused by memory leak or memory fragmentation?

Was it helpful?

Solution

Well, you can't do it using "top" command. The only way to detect memory leaks is by using special debugging tools called memory debugger. One example is "Valgrind" but there are many of them.

Another consideration is what is the program language of the program. If it is some modern script language with garbage collector - the memory leaks are not possible at all (of course if the language interpreter/compiler is not buggy).

Mostly the compiled, relatively low level languages are prone to memory leaks - like C, C++, Pascal, Assembly and similar.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top