What is memory leak testing? How can we test leak memory manually? What are automated tools available in market? Is it a white box or black box testing?

Showing Answers 1 - 6 of 6 Answers

ravikumar

  • Jul 14th, 2006
 

Memory leaks are blocks of allocated memory that the program no longer references. Memory leaks are bugs and should always be fixed. Leaks waste space by filling up pages of memory with inaccessible data and waste time due to extra paging activity. Leaked memory eventually forces the system to allocate additional virtual memory pages for the application, the allocation of which could have been avoided by reclaiming the leaked memory.

Following are the Details for Memory Leak Detection Tools:

Tools for tracking down memory leaks.

  • XPCOM Memory Leak tools (this document also has information on Mozilla's other memory leak tools). See also a tutorial on using these tools and the refcount balancer.
  • Rational Purify?. (Commercial)
  • GlowCode. (Commercial)
  • ElectricFence.

    "Electric Fence ... uses the virtual memory hardware of your system to detect when software overruns the boundaries of a malloc() buffer. It will also detect any accesses of memory that has been released by free(). Because it uses the VM hardware for detection, Electric Fence stops your program on the first instruction that causes a bounds violation."

    Specifically, it works by placing each heap allocation on its own VM page. Since the dynamic footprint of the browser is pretty large, this may make it tough to use "in real life".
  • Leaky. This is a home-grown tool that Kipp put together:
    • "Its a tool called leaky. What it does it help you track down memory leaks and some kinds of memory corruption. It also has entry pointers for logging addref/release calls. The key thing that leaky does is this: it logs all calls to malloc/free/realloc/new/delete into a log file. The logging data includes information about size and address, as well as the *call stack of the operation*. The leaky program then can translate the call stack data from addresses into symbols and then dump the data out." *
  • refcount balancer. This is another home-grown tool that does finer-grained instrumentation and allows you to focus on specific objects rather than entire runs.
  • Insure++?. (Commercial) Evaluation copy is free. Linux version.
  • LeakTracer.
  • ccmalloc.

  Was this answer useful?  Yes

For Testing C/C++ Based Applications You have

Valgrind

Which is again a Open source Testing tool

I have used the same

But Unlike Commercial tools It requires you to study docs Properly before you use it

It Runs your Application using comamnd Line switches and logs all Meory leaks to a Log File

But The Logs Can only be understood by person Having internal Knowledege

Of Code

Overall Memeory Leak Testing Can be termed as a White-box Testing Avctivity

as only the person who coded the application can understand the , exact points in the code  where in memory is not geting freed up

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions