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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing Virtual Memory

Status
Not open for further replies.

Citt1

MIS
Sep 17, 2003
57
US
Is there a way to clear virtual memory? A friend of mine got an error that he ran out of virtual memory. I know what virtual memory is and how it works. I recommended that he get more RAM and check how much space he has on his HDD. That should take care of the problem. But his question still bothered me. Is the a way to clear virtual memory manually without a reboot? Thanks.
 
Maybe you should see if his paging file size is large enough. Most people recommend at least 1.5 times the amount of memory. Other than that, I know there are some commercially available software around that can clear/recover lost memory but I'm not sure if that applies to virtual memory as well.
 
right-click My Computer, Properties, Advanced
Performance, Settings.

Set the Minimum and Maximum size to 0
Click Set, then Apply

Repeat the steps and return the settings to their original values.
 
Hear is a better way to clear the page file (virtual memory). WARNING: PERFORM THE FOLLOWING AT YOUR OWN RISK.

Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management.

Select ClearPageFileAtShutdown from the list on the right.

Right on it and select Modify.

Change the value to 1 (to enable).

Reboot

This way, the page file gets emprty every time you reboot. ALSO, set your page file max/min size settings to the same. This will help reduce fragmentation of the page file.
 
Two thoughts on pweegar's suggestion above:

. there is through gpedit.msc a Group Policy setting to enable this

. it adds signifcantly to your shutdown and startup times.
 
Have a look in Task Manager at the applications in use and how much ram they are using. Fidn the biggest hog and close it down. You'll probably find that the user hass a dozen web browsers open or something like that.
 
bcastner:
yes, I KNOW you can do it thru the group policy edit. However it isn't the friendlist interface I've ever seen. Using regedit and knowing where the key is located is just as easy (or difficult , depending on your view).

And it does NOT "significantly add to startup/shutdown times" in any way. At least not on my 3.0 GHZ pc. Maybe a slow machine, but definetly NOT on faster cpu's. The only thing with this machine (at work) is restoring all the network connections and the startup script. I have 10 network connections, down from 20 or so at one time.

And what you gain in system efficiency far out weighs the problems setting the page file to clear itself at shutdow and maybe a bit of slowdown at startup/shutdown.
 
pweegar said:
And what you gain in system efficiency far out weighs the problems setting the page file to clear itself at shutdow and maybe a bit of slowdown at startup/shutdown.

I consider this a very dubious claim. Not only is the claim of "system efficiency" spcecious, but universally you have a shutdown/startup loss.

I thought your original argument much better: set Minimum and Maximum size so that there is no dynamic allocation of the pagefile.sys.

The purpose of the cleaning of the pagefile.sys at shutdown was for security/privacy concerns, and had nothing to do with the efficiency of the filestore.
 
And I find your claim that shutdown/start times increase to be dubious also. Yes, I know it's also a security issue with clearing the pagefile. It's also a matter of efficiency to keep the page file as unfragmented as possible. In all the years I've been in IT (and it's ben a while), a large pagefile ALWAYS takes fore ever to defrag. NOr have I see extended startup, shutdown times.

And the orginal poster stated a possible problem with space and memory. That points to several possibilities.

 
If you think about it logically, if you have a 750mb pagefile and you set the machine to automatically delete it at shutdown then it will at least add the time it takes to delete such a large file. While it may only be 5-10 seconds, depending on your setup, I have seen this cause 30secs - 1 minute delays on some machines.

I personally don't see how deleting the file at each shutdown will make it less fragmented. When the file is created at next boot it will use up the free space that is available. If the drive is fragmented anyway then it will just use up the free fragments.

IMO the most effective way of storing the page file is the way I used to have, and will revert to at next reinstall, Windows on Primary IDE Channel, Page File on Second IDE channel in it's own partition. The Pagefile partition is set to 2gb and the page file is 768. This way windows handles the swapfile better as it is on a different IDE channel and defrag is easier as it is a simple 2gb drive defrag with a single file.


Greg Palmer
Freeware Utilities for Windows Administrators.
 
pwergeer,

I Googled this to see if I was completely full of it about the startup/shutdown issue. If you still find the issue "dubioius" consider a Google: "xp clear pagefile at shutdown issues"

There is nothing dubious about my earlier claims.

Best Holiday Wishes to you,
Bill Castner
 
hi,
please, look and advice:

1. first hard disk: c:\ cca. 30 GB with win xp pro up-to-date , rest d:\ cca. 90 GB for my data
2. second hard disk: e:\ cca. 120 GB with paging file and my data
3. cpu p4 2.4 GHz and 1 GB of RAM
4. virtual memory custom size e:\ size 1.000-1.500 MB
5. disk c:\ and d:\ - no paging file
6. diskeeper show only on disk e:\ one chunk (yellow color) for paging file
7. via group policy I had disable ''Shutdown: Clear virtual memory pagefile''

Now I'm confuse with all discussion about (un)fragmented pagefile:

is definition of pagefile correct (or optimal) ?
do I need to execute some defrag program ?

TIA
 
See: and:
Ideally what you want is to put the pagefile.sys on a second hard disk drive (using a partition on the same drive does not really help). Then, pre-allocate a pagefile.sys for your needs (see the two links above).

Once this fixed commitmant to a pagefile.sys is made, there should be no performance or defrag issues whatsoever.

The question is how large should the pagefile.sys be. My own guess as a general statement:

. if you have < 1 gb. RAM, use the 1.5x times physical RAM as both minimum and maximum values;
. if you have => 1 gb. RAM, use 768 mb. But use the tools in the Daniel Petri link to check for a while.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top