Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Out of Memory

Status
Not open for further replies.

shaunt

Programmer
Jun 12, 2002
4
GB
I am running approximately 140 applications on a server with 4 CPU's and 2GB
of memory in a prodcution environment.

The processes are started via DCOM in a seperate user account, thus creating
a new winstation in which to run. (This allows the processes to continue
to run when there is no-one logged onto the server.)

I have tweaked the SharedSection registry value to :
SharedSection= 1024,3072,2048

But i am still getting out of memory errors.
All of the processes are accessing and updating data (SQL Server 7.0). After
a period of about 2 to 3 weeks most of the processes running on the server
will stop responding with none or very little of them logging any errors
(no errors are ever found in the NT event log).
Performance monitor is indicating that the total amount of memory being used
by these processes is 460726272 (460 meg?).
My question's are:

1. Is the environment that these processes are in running out of memory?
2. How much memory is available when using the values set in the
SharedSection?
3. Help?

Any suggestions of other areas of possible liabilities would be appreciated.
 
It sounds like your applications may have memory leaks.
Does the amount of memory in use grow as time goes by?

If you have leaks then good luck to you in debugging 140 applications! You may want to consider scheduling a periodic reboot of the server!

If you are debugging, then make sure that any objects that are created are explicitly disposed of properly - close them where applicable (e.g. connections, recordsets, etc.) and set them to Nothing where you can. I even occasionally ReDim non-fixed arrays down to a single element (you can't get less than one element).

In short, if you use it then clean it & put it away again afterwards. Don't rely on VB to do your cleaning up for you.
 
Sounds like you definitely have memory leaks.
I made a tiny app that floats on top of everything monitoring the AvailPhysicalMemory API. It also has a text box I can enter a value subtracted from this so the main value looks like almost zero, with a refresh every second.
Watching all the applications in use over time, you can see even the slightest tendency for the memory to get progressively smaller - sometimes only by a few bytes at a time.
Typical is when you open a form, the memory reduces but it never goes back to the same original value when you close it.
This indicates a memory leak. Lots of commercial apps are full of them and eventually the system first bogs down and finally crashes.
There are many NT4 commercial tools available for this too but they dont always show a tiny leak if you gots loads of memory.
IExplorer5 has a memory leak if you open lots of screens and close them out of order.
Playing wav files causes leaks if the application starts them before another is finished without properly setting the first one to nothing.
 
Since Windows pages to disk, it's also possible to get out of memory errors if you run out of swap file space.
nick bulka

 
tedsmith

Would you mind posting the code for your 'Memory Monitor' app? It sounds very useful.

Thanks very much.
 
We just used the performance monitor which is an admin tool supplied with NT.
 
My memory meter works on win 95 and 98 and shows minute changes.
It has modules and a form code
How do you post a program in this Tek Tips thingy anyway?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top