Solved

How to check if there is a memory leak?

Posted on 1998-08-20
3
183 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

763 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