Solved

How to check if there is a memory leak?

Posted on 1998-08-20
3
180 Views
Last Modified: 2010-04-30
How do you check if my vb program (or any other program) has a memory leak problem?
0
Comment
Question by:yushimi
3 Comments
 
LVL 9

Accepted Solution

by:
cymbolic earned 50 total points
ID: 1430105
Use your system monitor.  THe NT monitor is especially useful.  Keep running your suspect app and view the availabel memory.  In extreme cases, your paging file activity will climb as well.  Of course, eventually, you will run out of virtual memory and your system will hang.  But you need to stress test your app, either keep rerunning it, or process a very large volume of data to get it to run long enough to see the effect.  The problem wiht many of the mory leaks is that they take out small pieces, and the effect only shows up in extended runs of the application, often cleaning itself up each time the app ends.
0
 
LVL 1

Expert Comment

by:rlarner
ID: 1430106
vb is, I believe, a system with automatic garbage collection.  This means that, in theory, there can be no memory leaks -- vb detects all "unused" memory and cleans it up.  I haven't worked enough with it to know if it truely works -- any VB gurus want to comment?

There is, however, a fairly easy way to narrow down where a memory leak is happening between different programs, if you know there is one.  Run Performance Monitor (PerfMon.exe), and add graph lines for each suspect process' Private Bytes.  You may also want to set the chart's options to increase the time between updates.  Then, perform a suspect activity MANY, MANY times.  (VB can push a button for you in a loop, etc.)  Check to see if private bytes has gone up significantly.


0
 

Author Comment

by:yushimi
ID: 1430107
how about win95?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now