Solved

How to check if there is a memory leak?

Posted on 1998-08-20
3
184 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

734 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