Managing Windows Virtual Memory


Once again GUI interfaces take to long, and use allot of resources so I am going to use command prompt to proceed.

I will use systeminfo command to list some Virtual Memory parameters, Maximum Size, Available and in use

H:\systeminfo |find "Virtual Memory"
Virtual Memory: Max Size:  8.523 MB
Virtual Memory: Available: 5.860 MB
Virtual Memory: In Use:    2.663 MB

I also will list physical memory

H:\systeminfo |find "Physical Memory"
Total Physical Memory:     3.000 MB
Available Physical Memory: 1.003 MB

I will use wmic to list all properties of paging files.

H:\wmic pagefile list
AllocatedBaseSize  CurrentUsage  Description      InstallDate                Name             PeakUsage  Status  TempPageFile
1024               297           C:\pagefile.sys  20111024150101.888020+060  C:\pagefile.sys  549                FALSE
4500               305           E:\pagefile.sys  20111108010816.872959+000  E:\pagefile.sys  551                FALSE

To configure the paging files use Wmic

C:\>wmic pagefile /?
PAGEFILE - Virtual memory file swapping management.
HINT: BNF for Alias usage.
(<alias> [WMIObject] | <alias> [<path where>] | [<alias>] <path where>) [<verb clause>].
USAGE:
PAGEFILE ASSOC [<format specifier>]
PAGEFILE CREATE <assign list>
PAGEFILE DELETE
PAGEFILE GET [<property list>] [<get switches>]
PAGEFILE LIST [<list format>] [<list switches>]

Example Script to set Paging FIle

REM Setting up the page file with Initial size of 150% physical memory and double for maximum size.
REM          GET THE PHYSICAL MEM SIZE AS DIGITS
FOR /F "eol=; tokens=1,2,3,4,5 delims=:, " %%i IN ('"systeminfo |find /i "Total Phy""') DO @Set /a  m=%%l%%m
REM          SET INITIAL MEMORY SIZE 150%of PHYSICAL MEMORY
set /a x=%m%*3/2
REM          SET MAXIMUM MEMORY 200% OF PHYSICAL MEMORY
set /a y=%m%*2
REM           CHANGE PAGE FILE TO MANUAL
wmic computersystem where name="%computername%" set AutomaticManagedPagefile=False
REM           SET PAGEFILE SIZE
wmic pagefileset where name="C:\\pagefile.sys" set InitialSize=%x%,MaximumSize=%y%

Don't forget reading about memory dump files http://technet.microsoft.com/en-us/library/ee424384%28v=ws.10%29.aspx#BKMK_Step2

Hope that this information can be useful.

Advertisements

About rodvars
Been working in IT Services/Consulting for the past 15 years. My main areas of work are planning, development, managing and administration System infrastructures focusing on optimizing user processes, enforcing business security, performance enhancements, high availabilty and infrastucture scalability.

One Response to Managing Windows Virtual Memory

  1. Raj says:

    Wonderful..I was searching for this command..Very well done and thanks a ton..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: