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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top