Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2005

Tip: Looking for answers? Try searching our database.

Pagefile control (Virtual memory

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Laurent M - 04 Aug 2005 01:15 GMT
I would like some assistance on a application I am developing in vb.net 2003
that uses a large dataset to query a database.  Most queires are small, and
execute with no problem.  When a large query is executed and stored in the
dataset, I use the garbage collector and the setProcessWorkingSetSize()
function to remove the data from memory when it is no longer needed.  This
works great for the RAM, but as far as the pagefile, it grows for every large
query and is not released untill program shutdown.

Thanks in advance.
S. Senthil Kumar - 04 Aug 2005 18:05 GMT
That's precisely what SetProcessWorkingSetSize does, it flushes unused
pages of the application in RAM to the pagefile.

Are you running out of virtual memory because of this? If not, you
don't need to worry, when VM gets low, the GC will kick in and compact
its heap, which will reduce the size of the pagefile as well.

Regards
Senthil
Laurent M - 04 Aug 2005 21:09 GMT
Senthil,
Thanks for your reply.  Actually I are running out of VM.  That is why I am
trying to flush the VM.  Any Ideas?

Thanks

> That's precisely what SetProcessWorkingSetSize does, it flushes unused
> pages of the application in RAM to the pagefile.
[quoted text clipped - 5 lines]
> Regards
> Senthil
Willy Denoyette [MVP] - 04 Aug 2005 23:23 GMT
> Senthil,
> Thanks for your reply.  Actually I are running out of VM.  That is why I
> am
> trying to flush the VM.  Any Ideas?
>
> Thanks

Don't use these function to reduce the WS, they aren't of any help (jeez, I
wonder why they have been included in the FCL), all you are doing in forcing
pages to be written to disk, but your problems is that you are consuming
more memory than available and I'm not talking about RAM I'm talking about
virtual address space.
A normal .NET application has something like 1.5MB  free VAS, but this space
(especially the Large Object Heap) can be higly fragmented such that only a
fraction of this is available in one large chunk.
Assume the largest free block is ~ 500MB, when your Dataset grows beyond
this , you will get OOM exceptions.
So what you have to do is; check the Dataset size and reduce it by returning
fewer rows or splitting the data over more than one Dataset you name it. If
your Dataset is not that large check other objects that might stay live when
not needed, in other words measure your memory consumption using tools like
CLRProfiler and perfmon.

Willy.


S. Senthil Kumar - 05 Aug 2005 07:21 GMT
"A normal .NET application has something like 1.5MB  free VAS"

I'm sure you meant 1.5 GB :).
Willy Denoyette [MVP] - 05 Aug 2005 08:56 GMT
> "A normal .NET application has something like 1.5MB  free VAS"
>
> I'm sure you meant 1.5 GB :).

Eek... back to DOS age!!!!

Thanks.
Willy.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.