Topics Index
Stress Help

Topics

Description

Fixed Allocations

The Executer

Options Menu

Logging Options

Initialization File

Creating an Automated Test


Description

The Stress application provides acquisition of system resources for low resource stress testing.  The acquirable resources include the global heap, user heap, GDI heap, disk space, and file handles.  Stress provides fixed, random, and message dependent allocations of these resources.  In addition, it provides several logging options to help locate and reproduce bugs.

Sub-Topics

Menus

Client Area Display


Menus

Stress has three main menus: settings, options, and help.  The settings menu provides access to all of Stress's dialog boxes, allowing fixed, executer, and log values to be modified.  The options menu allows the Stress display to be moved and the executer to be started.  The help menu contains information about Stress.


Client Area
Client Area Display

The client area display contains the current status of all of the resources.  This information is updated every time a Stress allocation is made or freed.  In addition, the screen updates itself every five seconds to accurately maintain the state of the system.  (See File Handles for information on how file handles are displayed.)


Fixed Allocations

Stress allows specific allocation values to be selected for any of the resources.  To access the fixed settings dialog box, simply select the "Fixed Settings" options from the "Settings" menu.  It contains five edit fields which specify the amount of the resource to leave available.  Thus, a value of "0" will consume an entire resource.  In addition, a value of  "-1" will free any Stress allocations for that resource.  Pressing the "SET" button will actually perform the specified allocations.  The "Free All" button simply sets all of the fields to "-1" and then performs a SET in order to free all Stress allocations.

Sub-Topics

Global Heap

User Heap

GDI Heap

Disk Space

File Handles


Global Heap

The global heap is specified in kilobytes and usually ranges from 1000 KB to your maximum memory limit (depends on your system).  Depending of your disk space and the size of your swap file, Windows will report different amounts available for the global memory.   Furthermore, if Stress is told to leave very little global heap available, Windows may increase the size of the swap file and report that a significant amount of memory is available when, in reality, there is almost none left.


User Heap

Windows requires the user heap to store certain information when an application is first run.  In addition, it is used to bring up dialog boxes and menus during the execution of a program.  The user heap is specified in bytes ranging from 0 to 65535.  Note that the value 65535 is equivalent to -1 and will free all Stress allocations for this resource.


GDI Heap

Windows performs graphics by using the memory provided in the GDI heap.  As a result, consuming the entire GDI heap will prevent the screen from being repainted properly.  As a matter of fact, if the entire memory is consumed and then freed, the screen will still need to be repainted even though Windows currently has enough memory to repaint.  For more information, see the Repaint Screen option.  Like the user heap, there is 64 KB available, and thus this field is specified in bytes ranging from 0

to 65535.


Disk Space

The amount of disk space to leave available is specified in megabytes.  The value only applies to the drive from which Stress was executed.  Thus, to test multiply partitioned hard drives, simply run Stress from the appropriate drive that needs to be stressed.  Stress will create a file called "stress.eat" in the root of the drive.  If the system crashes without Stress being exited, this file will still remain on the drive and should be deleted.


File Handles

File handles are used by many applications in order to gain access to files within the system.  Usually, an application is limited to about 20 file handles.  Stress can leave a very small number of file handles available to the system to make it easier to verify that an application is functioning properly when there are no file handles remaining.  Since determining the amount of file handles available within the system is time consuming, the client area of the main Stress Windows is not updated  every 5 seconds for file handles unless there are ten or less file handles available.   To force Stress to display the correct number of file handles, perform a Repaint Screen (CTRL-INS ).


The Executer

The executer allows applications to be tested while Stress dynamically allocates resources in the background.  One or more of the five resources can be requested to be allocated in the background.  There are two modes that the executer can be run in: random and message dependent.  The executer dialog box can be accessed by selecting the "Executer" option from the "Settings" menu.

Sub-Topics

General Parameters

Random Allocations

Message Dependent Allocations

ADVANCED Control


General Executer Parameters
General Parameters

Three parameters are common to both the random and message dependent allocation modes.  These include the stress level, seed, and the resources to allocate.


Strees Level
Stress Level

The stress level specifies how stressful the allocations should be.  There are 4 predefined stress levels, with level 4 being the most stressful.  See ADVANCED Control for information on changing the stress level ranges.


Seed

The seed determines the set of random or message dependent allocations that will be chosen.   If the same seed is used, the same dynamic allocations will occur each time the executer is run (although the affect of the allocations could be different if the state of the system has changed.)  The seed ranges from 0 to 65535, thus giving thousands of different execution paths.


Resources to Allocate

Within the executer dialog, there are five check boxes which specify the resources that should be allocated.  Any of these can be selected, but allocations to disk space and file handles are time consuming and could affect system performance.  Thus, before selecting either of these, make sure that it is really necessary to have executer allocations for it.  If random allocations are being used, selecting a reasonable time interval will make the disk accesses seem less intrusive.


Random Allocations

The executer's random mode will perform resource allocations depending on the time interval value from the executer dialog.  Approximately every time interval, the allocations will occur.  The value for the time interval ranges from 1 to 120 seconds.  The random setting will perform a very thorough stressing of an application, but the randomness makes reproducibility very difficult.


Message Dependent Allocations

Message dependent allocations occur when Windows sends a specific message to an application.  Stress sees the message, performs an allocation, and then sends the message to its original destination.  Only a certain set of messages, located in the list box of the executer dialog, can be selected.  This list contains Windows messages which result from user interaction.  Thus, tests are easier to reproduce.  They no longer depend on proper timing, since allocations are synchronized to specific actions such as clicking a mouse button or pressing a key on the keyboard.


ADVANCED Control

The advanced dialog box can be invoked by pushing the ADVANCED button in the executer dialog.  This dialog contains the ranges for the four stress levels.  It allows the ranges to be specifically configured to any system.


Options Menu

The options menu provides a facility to begin and end the executer, free the resources, move the Stress display, and repaint the screen.  Accelerators have been defined to provide quick access to all of these options.

Sub-Topics

Begin Executer

End Executer

Free All

Move to Corner

Put Back

Repaint Screen


Begin Executer
Begin Executer (CTRL HOME)

The begin executer selection starts the dynamic resource allocations.


End Executer
End Executer (CTRL END)

The end executer selection ends the dynamic resource allocations.  It leaves the state of the system according to the last allocation.  To remove the system from this state, simply select free all (CTRL DELETE), which frees all Stress allocations.


Free All
Free All (CTRL DELETE)

The free all selection will free all Stress allocations.  This command can be invoked at any time, even when the executer is running.  Notice, however, that if the executer is on, it will continue to run even though the memory has been freed temporarily.


Move to Corner
Move to corner (CTRL PAGE DOWN)

This selection moves the Stress display to the bottom corner of the screen and shrinks its size to the minimum needed to display the client area.


Put Back
Put back (CTRL PAGE UP)

This selection moves the Stress display back to its previous position before the move to corner selection was made.


Repaint Screen
Repaint Screen (CTRL INSERT)

This selection will repaint the entire screen.  Very often when heavily stressing the GDI heap, the screen is unable to be redrawn since there is not enough GDI memory.  When enough memory does become available to perform a repaint, Windows will not do it automatically.  As a result, Stress will do it when CTRL INSERT is pressed.  This is an important accelerator to remember, since it may be very difficult to find the menu selection when the screen is filled with garbage.  If the repaint fails, the GDI heap is still not large enough.  Type CTRL DELETE followed by CTRL INSERT to free the GDI and then repaint the screen.  Repainting the screen also has the side effect of recalculating the number of file handles within the system for the client area display.


Logging Options

Stress provides several logging options to help reproduce bugs.  Log information can be sent to a log file and/or a COM port.  Several different logging levels may be selected.  To set up logging select "Log Options" from the "Settings" menu.

Sub-Topics

Levels

COM port

Log File


Levels

There are 5 different logging levels ranging 1-5.  Level 1 logs nothing.  Level 2 logs only the most recent command to sent Stress.  Level 3 logs all commands sent to Stress.  Level 4 logs the resource status every 5-6 seconds.  Finally, level 5 logs all the past Stress commands and the resource status every 5-6 seconds.


COM port

A COM port can be selected by pushing the appropriate radio button.


Log File

A file may be selected by pushing the "Change Log File" push button.  When a valid file name has been chosen, it will be displayed in the log dialog beside the "Log to:" check box.  Check this box to log to the specified file.    If the file already exists, the original will be renamed as *.001 and then *.002, etcetera.  Thus, all old log files will be retained.


Initialization File

The file "stress.ini", located in the Windows directory, contains all initial settings for Stress.  Any option that can be set from a menu or a dialog box can be initialized in this INI file.  The section heading is "[stress]".  All of the keywords that are recognized beneath this section heading are described within the sub-topics below.

Sub-Topics

Fixed INI Variables

Executer INI Variables

Log INI Variables

Sample INI File


INI Fixed Info
Fixed

Five keywords apply to the fixed dialog, allowing any of the resources to be set initially.  The keywords are: GLOBAL, USER, GDI, DISK, and HANDLES.  For example, specifying USER = 30000 tells Stress to leave 30000 bytes of  user heap available on startup.  The default value for each of these keywords is -1 (leave all memory available).


INI Executer Info
Executer

There are eight different keywords associated with the executer.  These allow all the options to be set, and allow the executer begin on start up.

INI Variables

ALLOCATIONS

STRESS_LEVEL

SEED

TIME_INTERVAL

RESOURCES

MESSAGES

EXECUTER_ON

LEVEL1, LEVEL2, LEVEL3, LEVEL4


ALLOCATIONS

This keyword specifies the type of allocations to perform.  It can be either "random" or "message".  The default settings is "random".


STRESS_LEVEL

This keyword specifies the stress level at startup.  The default value is level 2.


SEED

This keyword specifies the initial seed for the allocations.  The default value is 1000.


TIME_INTERVAL

This keyword specifies the initial time interval for random mode.  The default value is 5.


RESOURCES

This keyword specifies the resources that will be initially selected in the executer.  There are five possibilities: "global", "gdi", "user", "disk", and "handles".  The RESOURCES keyword can be set to one or more of these choices.  If more than one is specified, separate the choices by spaces.  For example, specifying "RESOURCES = gdi user disk" would tell Stress to allocate the user heap, GDI heap, and disk space during executer mode.  The default setting is "user gdi".


MESSAGES

This keyword specifies the messages that will cause allocations in the message dependent mode.  The valid choices are any of the messages that appear in the executer's list box.  As for specifying resources, multiple messages must be separated by spaces.  The default value is to select no messages.


EXECUTER_ON

This keyword specifies whether or not the executer should begin at startup.  There are two valid values: "yes" and "no".  The default value is "no".


Levels

There are four keywords associated with setting the appropriate level ranges: LEVEL1, LEVEL2, LEVEL3, and LEVEL4.  Each of these has the same format, ten numbers separated by spaces:

LEVELX = globallow globalhigh userlow userhigh gdilow gdihigh disklow diskhigh hanlow hanhigh

For instance, if the ranges for level 4 needed to be:

Global: 2000 - 4000 MB,

User: 0 - 10000 bytes,

GDI: 0 - 5000 bytes,

Disk: 0 - 3 MB,

Handles: 0 - 10,

it would specified:	LEVEL4 = 2000 4000 0 10000 0 5000 0 3 0 10

The default levels are as follows:

LEVEL1 = 8000 10000 40000 55000 40000 55000 100 500 15 20

LEVEL2 = 6000 8000 25000 40000 25000 40000  60 100 10 15

LEVEL3 = 4000 6000 10000 25000 10000 25000 20 60 5 10

LEVEL4 = 2000 4000 0 10000 0 10000 0 20 0 5


INI Log Info
Log

There are four keywords associated with initializing the logging dialog.  These allow the logging level and logging location to be specified.

INI Variables

LOG_LEVEL

FILENAME

FILE_ON

COM


LOG_LEVEL

This keyword specifies the logging level at startup.  It can range from 1-5.  The default value is 1 (no logging).


FILENAME

This keyword specifies a fully qualified path and file name for the log file.  The default value is no file name.


FILE_ON

This keyword determines whether or not logging to the file should begin at startup.  The valid values for this keyword are "yes" and "no".  The default value is "no".


COM

The COM keyword specifies the COM port to log to.  The value can range from 0-4, where 0 specifies no COM.  The default value is 0.


Sample INI File

The following is a sample INI file telling Stress to run in message dependent executer mode at startup, making WM_CHAR, WM_SYSKEYDOWN, and WM_LBUTTONUP messages cause allocations to the GDI heap and disk.

[stress]

GLOBAL = 4500.23

USER = 29000

GDI = 20000

DISK = 45.45

STRESS_LEVEL = 3

SEED = 17890

RESOURCES = gdi disk

ALLOCATIONS = message

MESSAGES = WM_CHAR WM_SYSKEYDOWN WM_LBUTTONUP

EXECUTER_ON = yes

Notice that the system is also given an initial state, specified by the GLOBAL, USER, GDI, and DISK initialization variables.   The GDI and disk will remain in this state until the first valid message causes new allocations to be made.


Creating an Automated Test

Stress does not provide any command line options.  However, every possible setting within Stress can be configured in the INI file.  To test an application using Stress, begin by creating a 'stress.ini' file containing the required settings for the test.  Then, before executing Windows, simply copy this INI file to the windows directory.  Finally, execute Stress and then run the application that requires the testing.  This sequence can be completely automated via a batch file.