The MASM Forum

General => The Campus => Topic started by: Grincheux on January 07, 2016, 04:05:30 AM

Title: POLINK
Post by: Grincheux on January 07, 2016, 04:05:30 AM
What means the option "/WS:AGRESSIVE"?
Title: Re: POLINK
Post by: ragdog on January 07, 2016, 04:10:18 AM
I think its same like ms linker

Quote


/WS:AGGRESSIVE

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.
Title: Re: POLINK
Post by: Grincheux on January 07, 2016, 04:47:53 AM
Quoteloader will recognize this attribute and aggressively trim

Yes but it this sentence that I do not understand. I already read this without understand.
I am French and my english is poor.
Title: Re: POLINK
Post by: Vortex on January 07, 2016, 06:42:49 AM
Reading Pelles manual :

Quote/WS Specifies aggressive trimming of the 'working set' (appears to be obsolete).

Syntax:
/WS:AGGRESSIVE

Description:
The /WS:AGGRESSIVE option tells the operating-system to aggressively trim the linked executables "working set" when run. This option should only be used on programs that mainly works in the background, and has varying amount of work to do. One example of this is a screensaver. The IMAGE_FILE_AGGRESIVE_WS_TRIM flag will be set in the file header of the linked executable. See Microsoft Windows documentation for more information about this flag (the flag appears to be obsolete).
Title: Re: POLINK
Post by: Grincheux on January 07, 2016, 06:51:42 AM
I don't understand any more but I can forget it.
Title: Re: POLINK
Post by: jj2007 on January 07, 2016, 07:50:19 AM
Quote from: ragdog on January 07, 2016, 04:10:18 AM... aggressively trim the working set of the process when it is not active.

By default, Windows is generous with applications, and assigns more megabytes than really needed. The /WS option was meant to prevent this behaviour, especially for small executables that are launched in great numbers e.g. on servers. Imagine you get a thousand requests in parallel on a server, it launches a thousand little proggies in parallel that just open a database, collect a few bytes and send it to the client. If each of these proggies gets 10 MBytes by default, the server will break down.

I have made some tests with a graphics-intensive application, see "Simple Graphics" (http://masm32.com/board/index.php?topic=94.msg51060#msg51060). Attached three executables:
- xx_default  with default settings for the application, which include an invoke EmptyWorkingSet
- xx_noEWS  same but no such invoke
- xx_WsAgg  same but /WS:aggressive as linker option

The screenshot below shows that the linker option has absolutely no effect.
Title: Re: POLINK
Post by: Grincheux on January 07, 2016, 09:47:40 AM
Very Clear

It's a kind of /CP:1 at the msdos time
But /CP:1 was good and had effect on memory but here 12Kb!