[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;
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.
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.
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. |
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.
Windows NT: Requires version 5.0 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winnt.h.
Processes and Threads Overview, Process and Thread Structures, GetProcessAffinityMask, JOBOBJECT_END_OF_JOB_TIME_INFORMATION, QueryInformationJobObject, SetInformationJobObject, SetProcessWorkingSetSize