This documentation is archived and is not being maintained.

/WS (Aggressively Trim Process Memory)

Visual Studio .NET 2003

Use the /WS:AGGRESSIVE option to add the WS_AGGRESSIVE attribute to your application's image. The Windows NT 4.0 (and later) loader will recognize this attribute and aggressively trim the working set of the process when it is not active. Using this option is similar to adding the following call throughout your application.

SetProcessWorkingSetSize(GetCurrentProcess(), 0xffffffff, 0xffffffff);

/WS:AGGRESSIVE can be used for applications that must have a low impact on the system's memory pool.

If the speed of your application is important, do not use /WS:AGGRESSIVE without testing the resulting performance implications. Ideal candidates are processes that tend to operate in the background, such as services and screen savers.

To set this linker option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
  2. Click the Linker folder.
  3. Click the Command Line property page.
  4. Type the option into the Additional Options box.

To set this linker option programmatically

See AdditionalOptions Property.

See Also

Setting Linker Options | Linker Options