RAM Memory problem VS2003 C#

G

Guest

I was build an application that it is using SQL server database. The clients
are conecting to the SQL server that resides on an server machine.
The application works on W2K or XP with .Net Framework 1.1. with SP1 and
have forms that have closer to 100 dataadapters on one form.
The application it is working fine on the computer with large amount of
memory i.e 512MB of RAM but on less ie 256MB sometimes the computer it is
blocked. I checked with the memory/process taskmanager and I show that
sometimes it is coming to the 120-150 MB used. When I opened a form than it
is adding more memory to be used. When I closed the form that memory it isnot
released. Even I keep only the application with the main form opened after
closing all the form the memory remain almost at the last amount used. The
only way to release the memory it is to minimize the application and to
restore. In such way the RAM memory it is freed immediatelly.
We done something wrong into the code?
It is a way to manage this?
I will very much appreciate an helping hand.
Thank you.
 
B

Brian P

Hello Marius,

There a few postings about this out and about, I found one here:

http://dotnet247.com/247reference/msgs/15/77895.aspx

The gist is this:
"When a program is getting minimized, the OS invokes SetProcessWorkingSet()
API to minimize the amount of memory used by that process.

Though .Net doesn't expose this API completely, you can still solve the
problem by either invoking the Win32 API directly through PInvoke or you can
set the ProcessWorkingSet by using System.Diagnostics.Process clsss.

This will eliminate iconising the process to free up some memory.

Improper working set may adversely affect the performace of the process as
well as the system."


You can call the SetProcessWorkingSet manually. I'm sure the experts on
this ng will point on the pro's and con's to this.....



--Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top