|
Author
|
Topic: Memory leak test for .exe
|
aelana New Member
Posts: 0 Registered: Aug 2002
|
posted 08-08-2002 08:41 AM
Is there a way to test for memory leak for executable applications? I'm actually an embedded software tester but every now and then, we also test application software (download/upload data to and from watch). This time, I am tasked to test a software developed by a third party, where we only get the executable file. I've been searching for the things I need test and this forum helped me a lot. So any help would be very much appreciated.------------------

|
RSBarber Moderator
   
Posts: 852 Registered: Jul 2002
|
posted 08-08-2002 08:46 AM
An executable on a windows system? The file executes, does stuff in the background, then closes? I have some ideas for you if that is the case. Let me know if that is an accurate description.------------------ Scott Barber NOBLE(STAR Sr. Performance Engineer sbarber@noblestar.com http://www.noblestar.com

|
aelana New Member
Posts: 0 Registered: Aug 2002
|
posted 08-08-2002 08:48 AM
Yes, windows application. The user opens the program, does some stuff (upload/download data from/to watch) and then close the application. ------------------

|
aelana New Member
Posts: 0 Registered: Aug 2002
|
posted 08-08-2002 09:43 AM
I mean, application for a windows system.------------------

|
dlg99 Member
Posts: 7 Registered: Sep 2001
|
posted 08-08-2002 10:03 AM
quote: Originally posted by aelana: Is there a way to test for memory leak for executable applications?
Look at the Rational Purify. But keep in mind it that it also will find some memory leaks in the MS libs used by tested application =)

|
John J. Miller Advanced Guru
    
Posts: 523 Registered: Feb 2000
|
posted 08-08-2002 10:03 AM
BoundsChecker works that way. John
------------------

|
aelana New Member
Posts: 0 Registered: Aug 2002
|
posted 08-08-2002 10:09 AM
Since we don't do this kind of test often, it won't be wise for the company to buy expensive softwares. I would have to agree though that having one is the best way to test. So I'm soliciting any idea on how to test for memory leaks without purchasing any software... freeware should be great!  ------------------

|
RSBarber Moderator
   
Posts: 852 Registered: Jul 2002
|
posted 08-08-2002 11:06 AM
Ok - no tool. - Write a batch file to launch the executable from the command line over and over while watching task manager/perfmon. - Download a demo or a trial version of a testing tool that can execute a script over and over while watching task manager/perfmon.The key will be to launch/execute/then close over and over while monitoring memory with as little else going on as possible. ------------------ Scott Barber NOBLE(STAR Sr. Performance Engineer sbarber@noblestar.com http://www.noblestar.com

|
aelana New Member
Posts: 0 Registered: Aug 2002
|
posted 08-08-2002 11:12 AM
So how will I know that there's a leaking problem?------------------

|
Gilbert Advanced Guru
    
Posts: 691 Registered: Jul 1999
|
posted 08-08-2002 03:32 PM
quote: Originally posted by aelana: So how will I know that there's a leaking problem?
So in the Task Manager, check out all the info regarding Memory. Write down the numbers before you run your test(s). Do a few iterations or test runs then check those Memory info again and compare with the original numbers you saw before running your test. If there's a Memory Leak, you should see, for example, that MEM Usage is higher or much higher than before. If there's no Memory Leak problem, the numbers you see before and after running and closing your application should be the same. (If you have an old old copy of MS Excel, v1.0 i guess, you can see this Memory Leak problem very easily by simply running and closing it.)
------------------

|
RSBarber Moderator
   
Posts: 852 Registered: Jul 2002
|
posted 08-08-2002 03:32 PM
Memory leaks are detected by viewing memory usage. When the .exe is launched, it will take up a piece of memory, and SHOULD give it all back when it is done. If you launch the application and close it over and over and find that more memory is being used when you are done then when you started, that is an indication of a memory leak. If you have access to a developer/systems administrator, they should be able to show you how to monitor memory on a windows machined and determine if there are indications of a memory leak. ------------------ Scott Barber NOBLE(STAR Sr. Performance Engineer sbarber@noblestar.com http://www.noblestar.com

|
rtehve Advanced
 
Posts: 160 Registered: Aug 2000
|
posted 08-08-2002 04:17 PM
aelanaMemory leak testing in windows is a complex operation. Firstly you will have to decide how many configurations and service pack variations you need to cover. The fewer the better. The next issue you will have to deal with is caching as this will at best cause transient memory effects. To cancel these out you may have to open and close an application several times. The next complication is that various versions/configurations are in fact leaky by itself and you may need to test this in abscence of the target application. Initially you will need to test for memory leaks in a standalone fashion and then with other applications running, switching between them. Also if you application uses a comm stack you will need to test connections and disconnections for leaks. The simplest method I use is coming up wth the most commonly used configuration and do a cycle test (Automated) of opening the target software, using it and then closing it. Reapeat this 50-100 times in a row and see if windows crashes or shows significant leaks. If it survives this then I start looking at other tests. ------------------ Robert Tehve rtehve@bigpond.com [This message has been edited by rtehve (edited 08-08-2002).]

|
punekar Advanced Guru
    
Posts: 588 Registered: Dec 2000
|
posted 08-08-2002 09:58 PM
Some frameworks like MFC have support for memory and resource leak detection. Like the class CMemoryState.Here's some information from the MSDN collection: CMemoryState provides a convenient way to detect memory leaks in your program. A "memory leak" occurs when memory for an object is allocated on the heap but not deallocated when it is no longer required. Such memory leaks can eventually lead to out-of-memory errors. There are several ways to allocate and deallocate memory in your program: Using the malloc/free family of functions from the run-time library. Using the Windows API memory management functions, LocalAlloc/LocalFree and GlobalAlloc/GlobalFree. Using the C++ new and delete operators. The CMemoryState diagnostics only help detect memory leaks caused when memory allocated using the new operator is not deallocated using delete. The other two groups of memory-management functions are for non-C++ programs, and mixing them with new and delete in the same program is not recommended. An additional macro, DEBUG_NEW, is provided to replace the new operator when you need file and line-number tracking of memory allocations. DEBUG_NEW is used whenever you would normally use the new operator.
------------------ -Suresh Nageswaran punekar@yahoo.com Cognizant Technology Solutions, Pune, India.

|
aelana New Member
Posts: 0 Registered: Aug 2002
|
posted 08-09-2002 08:08 AM
Many thanks to all of you. ------------------

|
aelana New Member
Posts: 0 Registered: Aug 2002
|
posted 08-12-2002 10:53 AM
One more thing. How critical is a memory leak problem for a windows application?------------------

|