Home > Commands A-M > Commands Ch-Cz

CLEARMEM


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Forces pages out of RAM.

Attempts to allocate and commit more memory then is physically available, as well as flushing the file cache. In Windows, working sets are allowed to grow until memory pressure forces them to decline. Flushing the file cache is important because some pages in the process working set are part of the file cache (for example, code loaded from a file).


Syntax

CLEARMEM /?

CLEARMEM [-B] [-D] [-Mnumber] [-Pnumber] [-Q] [-Tnumber] [-W]


Parameters

none.


Switches
/? (NT2000)
Display help.
-B (NT2000)
Read and write the virtual memory section.
-D (NT2000)
Debug break on entry into and exit from application.
-Mnumber (NT2000)
Number of megabytes to allocate. Default is use all physical memory.
-Pnumber (NT2000)
Number of pages to read. Default is 63.
-Q (NT2000)
Quiet mode, print nothing.
-Tnumber (NT2000)
times to touch a page. Default is 1.
-W (NT2000)
Write to the virtual memory section.

Related

none.


Notes

Running twice will usually force most applications out of memory. Has to run multiple times to present a real-life memory load because the system does not immediately trim all possible pages in a process working set, but does so gradually over time. When run, the system pauses because of the flood of high priority activity.

Note: Use Vadump to see the contents of the working set.

To run, the computer's paging file must be at least as large as its RAM. If you are running Windows Server configured for "Maximize Throughput for Network Applications," you might have to run more than twice to reduce application working sets to the minimum. Use System Monitor to check on progress.

Working set: a set of memory pages. It is all the physical pages "owned" by a process. Each memory page can be:


Examples

none.


Errorlevels

none.


Availability
External Resource Kit
DOS
none
Windows
none
Windows NT
NT2000