JobObjectLimits Class

Defines a job object limits.

public sealed class JobObjectLimits

Remarks

A limit applies only when its property is set to a non-null value. Leave a property null - the default - to leave that limit alone.

Example

using var job = new JobObject();
var limits = new JobObjectLimits
{
    Flags = JobObjectLimitFlags.KillOnJobClose,
    ActiveProcessLimit = 10,
    ProcessMemoryLimit = 100 * 1024 * 1024, // 100 MB
};
job.SetLimits(limits);

Constructors

NameDescription
JobObjectLimits()

JobObjectLimits()

public JobObjectLimits()

No documentation is available.

Properties

NameDescription
ActiveProcessLimitGets or sets the active process limit for the job.
AffinityGets or sets the processor affinity for all processes associated with the job.
FlagsDefines options for a job object.
JobMemoryLimitGets or sets limit for the virtual memory that can be committed for the job.
MaximumWorkingSetSizeGets or sets the maximum working set size for each process associated with the job.
MinimumWorkingSetSizeGets or sets the minimum working set size for each process associated with the job.
PerJobUserTimeLimitGets or sets the per-job user-mode execution time limit, in 100-nanosecond ticks.
PerProcessUserTimeLimitGets or sets the per-process user-mode execution time limit, in 100-nanosecond ticks.
PriorityClassGets or sets priority class for all processes associated with the job.
ProcessMemoryLimitGets or sets the limit for the virtual memory that can be committed by a process.
SchedulingClassGets or sets scheduling class for all processes associated with the job.

ActiveProcessLimit

JobObjectLimits.cs

Gets or sets the active process limit for the job.

public uint? ActiveProcessLimit { get; set; }

Property value

uint? The active process limit for the job, or null to apply no limit. A value of 0 is an explicit limit of zero processes, which makes the job reject every process.

Gets or sets the processor affinity for all processes associated with the job.

public nuint? Affinity { get; set; }

Property value

nuint? The processor affinity for all processes associated with the job, or null to apply no limit.

Defines options for a job object.

public JobObjectLimitFlags Flags { get; set; }

Property value

JobObjectLimitFlags The options for a job object.

JobMemoryLimit

JobObjectLimits.cs

Gets or sets limit for the virtual memory that can be committed for the job.

public nuint? JobMemoryLimit { get; set; }

Property value

nuint? The limit for the virtual memory that can be committed for the job, or null to apply no limit.

MaximumWorkingSetSize

JobObjectLimits.cs

Gets or sets the maximum working set size for each process associated with the job.

public nuint? MaximumWorkingSetSize { get; set; }

Property value

nuint? The maximum working set size for each process associated with the job, or null to apply no limit.

Remarks

Windows applies the working set limit only when both JobObjectLimits.MinimumWorkingSetSize and JobObjectLimits.MaximumWorkingSetSize are set.

MinimumWorkingSetSize

JobObjectLimits.cs

Gets or sets the minimum working set size for each process associated with the job.

public nuint? MinimumWorkingSetSize { get; set; }

Property value

nuint? The minimum working set size for each process associated with the job, or null to apply no limit.

Remarks

Windows applies the working set limit only when both JobObjectLimits.MinimumWorkingSetSize and JobObjectLimits.MaximumWorkingSetSize are set.

PerJobUserTimeLimit

JobObjectLimits.cs

Gets or sets the per-job user-mode execution time limit, in 100-nanosecond ticks.

public long? PerJobUserTimeLimit { get; set; }

Property value

long? The per-job user-mode execution time limit, in 100-nanosecond ticks, or null to apply no limit.

PerProcessUserTimeLimit

JobObjectLimits.cs

Gets or sets the per-process user-mode execution time limit, in 100-nanosecond ticks.

public long? PerProcessUserTimeLimit { get; set; }

Property value

long? The per-process user-mode execution time limit, in 100-nanosecond ticks, or null to apply no limit.

PriorityClass

JobObjectLimits.cs

Gets or sets priority class for all processes associated with the job.

public uint? PriorityClass { get; set; }

Property value

uint? The priority class for all processes associated with the job, or null to apply no limit.

ProcessMemoryLimit

JobObjectLimits.cs

Gets or sets the limit for the virtual memory that can be committed by a process.

public nuint? ProcessMemoryLimit { get; set; }

Property value

nuint? The limit for the virtual memory that can be committed by a process, or null to apply no limit.

SchedulingClass

JobObjectLimits.cs

Gets or sets scheduling class for all processes associated with the job.

public uint? SchedulingClass { get; set; }

Property value

uint? The scheduling class for all processes associated with the job, or null to apply no limit.