JOBOBJECT_BASIC_LIMIT_INFORMATION

[This is preliminary documentation and subject to change.]

The JOBOBJECT_BASIC_LIMIT_INFORMATION structure contains basic limit information for a job object.

typedef struct _JOBOBJECT_BASIC_LIMIT_INFORMATION {
    LARGE_INTEGER PerProcessUserTimeLimit;
    LARGE_INTEGER PerJobUserTimeLimit;
    DWORD LimitFlags;
    DWORD MinimumWorkingSetSize;
    DWORD MaximumWorkingSetSize;
    DWORD ActiveProcessLimit;
    DWORD Affinity;
    DWORD PriorityClass;
} JOBOBJECT_BASIC_LIMIT_INFORMATION, *PJOBOBJECT_BASIC_LIMIT_INFORMATION;
 

Members

PerProcessUserTimeLimit
Ignored unless LimitFlags specifies JOB_OBJECT_LIMIT_PROCESS_TIME. Specifies the per-process user-mode execution time limit, in 100-nanosecond ticks.

The system periodically checks to see if each process associated with the job object has accumulated more user-mode time than the set limit. If it has, the process is terminated.

PerJobUserTimeLimit
Ignored unless LimitFlags specifies JOB_OBJECT_LIMIT_JOB_TIME. Specifies the per-job user-mode execution time limit, in 100-nanosecond ticks.

The system periodically checks to see if the sum of the user-mode execution time for all processes is greater than this end-of-job limit. If it is, the action specified in the EndOfJobTimeAction member of the JOBOBJECT_END_OF_JOB_TIME_INFORMATION structure is carried out. By default, all processes are terminated and the status code is set to ERROR_NOT_ENOUGH_QUOTA.

LimitFlags
Specifies the limit flags that are in effect. This member is a bit field that determines whether other structure members are used. Any combination of the following values can be specified.
Value Meaning
JOB_OBJECT_LIMIT_ACTIVE_PROCESS Establishes a maximum number of simultaneously active processes associated with the job object.
JOB_OBJECT_LIMIT_AFFINITY Causes all processes associated with the job object to use the same processor affinity.
JOB_OBJECT_LIMIT_JOB_TIME Establishes a user-mode execution time limit for the job object.
JOB_OBJECT_LIMIT_PRIORITY_CLASS Causes all processes associated with the job to use the same priority class. For more information, see Scheduling Priorities.
JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME Preserves any job time limits you previously set. As long as this flag is set, you can establish a per-job time limit once, then alter other limits in subsequent calls.
JOB_OBJECT_LIMIT_PROCESS_TIME Establishes a user-mode execution time limit for each currently active process and for all future processes associated with the job object.
JOB_OBJECT_LIMIT_WORKINGSET Causes all processes associated with the job to use the same minimum and maximum working set sizes.

MinimumWorkingSetSize
Ignored unless the LimitFlags member specifies JOB_OBJECT_LIMIT_WORKINGSET. Specifies the minimum working set size for all processes associated with the job object.
MaximumWorkingSetSize
Ignored unless LimitFlags specifies JOB_OBJECT_LIMIT_WORKINGSET. Specifies the maximum working set size for all processes associated with the job object.
ActiveProcessLimit
Ignored unless LimitFlags specifies JOB_OBJECT_LIMIT_ACTIVE_PROCESS. Specifies the active process limit for the job object. If you try to associate a process with a job object, and this causes the active process count to exceed this limit, the process is terminated and the association fails.
Affinity
Ignored unless LimitFlags specifies JOB_OBJECT_LIMIT_AFFINITY. Specifies the processor affinity for all processes associated with the job object. The affinity must be a proper subset of the system affinity mask obtained by calling the GetProcessAffinityMask function. The affinity of each thread is set to this value, but threads are free to subsequently set their affinity, as long as it is a subset of the specified affinity mask. Processes cannot set their own affinity mask.
PriorityClass
Ignored unless LimitFlags specifies JOB_OBJECT_LIMIT_PRIORITY_CLASS. Specifies the priority class for all processes associated with the job object. Processes and threads cannot increase their priority class. The calling process must have the SE_INCREASEBASEPRIORITY_NAME privilege.

Remarks

Processes can still empty their working sets using the SetProcessWorkingSetSize function, even when JOB_OBJECT_LIMIT_WORKINGSET is used. However, you cannot use SetProcessWorkingSetSize to change the minimum or maximum working set size.

The system increments the active process count when you attempt to associate a process with a job object. If the limit is exceeded, the system decrements the active process count only when the process terminates and all handles to the process are closed. Therefore, if you have an open handle to a process that has been terminated in such a manner, you cannot associate any new processes until the handle is closed and the active process count is below the limit.

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in winnt.h.

See Also

Processes and Threads Overview, Process and Thread Structures, GetProcessAffinityMask, JOBOBJECT_END_OF_JOB_TIME_INFORMATION, QueryInformationJobObject, SetInformationJobObject, SetProcessWorkingSetSize