/WS (Aggressively Trim Process Memory)
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
- Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
- Click the Linker folder.
- Click the Command Line property page.
- Type the option into the Additional Options box.
To set this linker option programmatically