The online community for software testing & quality assurance professionals
   
Active Topics Today's Topics
Sponsors:
Lost Password?

Home
BetaSoft
Jobs
Training
News
Links
Downloads

News Group:
software.testing


Testing
Automation
Performance
Engineering
Miscellaneous
Statistics
Poll
  QA Forums
  General Discussion
  Memory leak test for .exe (Page 1)

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone!
This topic is 2 pages long:   1  2 
next newest topic | next oldest topic
Author Topic:   Memory leak test for .exe
aelana
New Member

Posts: 0
Registered: Aug 2002

posted 08-08-2002 08:41 AM     Click Here to See the Profile for aelana   Edit/Delete Message Copy This Message   Reply w/Quote Search for more posts by aelana
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.

------------------

IP Logged

RSBarber
Moderator

Posts: 852
Registered: Jul 2002

posted 08-08-2002 08:46 AM     Click Here to See the Profile for RSBarber   Edit/Delete Message Copy This Message   Reply w/Quote Search for more posts by RSBarber Visit RSBarber's Homepage!
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

IP Logged

aelana
New Member

Posts: 0
Registered: Aug 2002

posted 08-08-2002 08:48 AM     Click Here to See the Profile for aelana   Edit/Delete Message Copy This Message   Reply w/Quote Search for more posts by aelana
Yes, windows application. The user opens the program, does some stuff (upload/download data from/to watch) and then close the application.

------------------

IP Logged

aelana
New Member

Posts: 0
Registered: Aug 2002

posted 08-08-2002 09:43 AM     Click Here to See the Profile for aelana   Edit/Delete Message Copy This Message   Reply w/Quote Search for more posts by aelana
I mean, application for a windows system.

------------------

IP Logged

dlg99
Member

Posts: 7
Registered: Sep 2001

posted 08-08-2002 10:03 AM     Click Here to See the Profile for dlg99   Edit/Delete Message Copy This Message   Reply w/Quote Search for more posts by dlg99
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 =)

IP Logged

John J. Miller
Advanced Guru

Posts: 523
Registered: Feb 2000

posted 08-08-2002 10:03 AM     Click Here to See the Profile for John J. Miller   Edit/Delete Message Copy This Message   Reply w/Quote Search for more posts by John J. Miller
BoundsChecker works that way.


John

------------------

IP Logged

aelana
New Member

Posts: 0
Registered: Aug 2002

posted 08-08-2002 10:09 AM     Click Here to See the Profile for aelana   Edit/Delete Message Copy This Message   Reply w/Quote Search for more posts by aelana
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!

------------------

IP Logged

RSBarber
Moderator

Posts: 852
Registered: Jul 2002

posted 08-08-2002 11:06 AM     Click Here to See the Profile for RSBarber   Edit/Delete Message Copy This Message   Reply w/Quote Search for more posts by RSBarber Visit RSBarber's Homepage!
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

IP Logged

aelana
New Member

Posts: 0
Registered: Aug 2002

posted 08-08-2002 11:12 AM     Click Here to See the Profile for aelana   Edit/Delete Message Copy This Message   Reply w/Quote Search for more posts by aelana
So how will I know that there's a leaking problem?

------------------

IP Logged

Gilbert
Advanced Guru

Posts: 691
Registered: Jul 1999

posted 08-08-2002 03:32 PM     Click Here to See the Profile for Gilbert   Edit/Delete Message Copy This Message   Reply w/Quote Search for more posts by Gilbert
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.)


------------------

IP Logged

RSBarber
Moderator

Posts: 852
Registered: Jul 2002

posted 08-08-2002 03:32 PM     Click Here to See the Profile for RSBarber   Edit/Delete Message Copy This Message   Reply w/Quote Search for more posts by RSBarber Visit RSBarber's Homepage!
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

IP Logged

rtehve
Advanced

Posts: 160
Registered: Aug 2000

posted 08-08-2002 04:17 PM     Click Here to See the Profile for rtehve   Edit/Delete Message Copy This Message   Reply w/Quote Search for more posts by rtehve
aelana

Memory 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).]

IP Logged

punekar
Advanced Guru

Posts: 588
Registered: Dec 2000

posted 08-08-2002 09:58 PM     Click Here to See the Profile for punekar   Edit/Delete Message Copy This Message   Reply w/Quote Search for more posts by punekar Visit punekar's Homepage!
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.

IP Logged

aelana
New Member

Posts: 0
Registered: Aug 2002

posted 08-09-2002 08:08 AM     Click Here to See the Profile for aelana   Edit/Delete Message Copy This Message   Reply w/Quote Search for more posts by aelana
Many thanks to all of you.

------------------

IP Logged

aelana
New Member

Posts: 0
Registered: Aug 2002

posted 08-12-2002 10:53 AM     Click Here to See the Profile for aelana   Edit/Delete Message Copy This Message   Reply w/Quote Search for more posts by aelana
One more thing. How critical is a memory leak problem for a windows application?

------------------

IP Logged


This topic is 2 pages long:   1  2 

All times are PT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic | Top
Post New Topic  Post A Reply
Hop to:

Contact Us | BetaSoft Inc. | Privacy Statement

Copyright © 1997-2003 BetaSoft Inc.


Ultimate Bulletin Board 5.45c