Solved

How to check if there is a memory leak?

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 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…
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…

759 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

20 Experts available now in Live!

Get 1:1 Help Now