Kernel32SetProcessWorkingSetSizeEx Method
Sets the minimum and maximum working set sizes for the specified process.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", SetLastError = true)]
public static bool SetProcessWorkingSetSizeEx(
IntPtr hProcess,
IntPtr minWorkingSetSize,
IntPtr maxWorkingSetSize,
SetProcessWorkingSetSizeFlags flags
)
<DllImportAttribute("Kernel32.dll", SetLastError := true>]
Public Shared Function SetProcessWorkingSetSizeEx (
hProcess As IntPtr,
minWorkingSetSize As IntPtr,
maxWorkingSetSize As IntPtr,
flags As SetProcessWorkingSetSizeFlags
) As Boolean
Dim hProcess As IntPtr
Dim minWorkingSetSize As IntPtr
Dim maxWorkingSetSize As IntPtr
Dim flags As SetProcessWorkingSetSizeFlags
Dim returnValue As Boolean
returnValue = Kernel32.SetProcessWorkingSetSizeEx(hProcess,
minWorkingSetSize, maxWorkingSetSize,
flags)
public:
[DllImportAttribute(L"Kernel32.dll", SetLastError = true)]
static bool SetProcessWorkingSetSizeEx(
IntPtr hProcess,
IntPtr minWorkingSetSize,
IntPtr maxWorkingSetSize,
SetProcessWorkingSetSizeFlags flags
)
[<DllImportAttribute("Kernel32.dll", SetLastError = true)>]
static member SetProcessWorkingSetSizeEx :
hProcess : IntPtr *
minWorkingSetSize : IntPtr *
maxWorkingSetSize : IntPtr *
flags : SetProcessWorkingSetSizeFlags -> bool
No code example is currently available or this language may not be supported.
- hProcess IntPtr
-
A handle to the process whose working set sizes is to be set.
The handle must have SetQuota access rights.
- minWorkingSetSize IntPtr
-
The minimum working set size for the process, in bytes.
The virtual memory manager attempts to keep at least this much memory resident in the process
whenever the process is active.
This parameter must be greater than 0 but less than or equal to the maximum working set size.
The default size is 50 pages (for example, this is 204,800 bytes on systems with a 4K page size).
If the value is greater than 0 but less than 20 pages, the minimum value is set to 20 pages.
If both minWorkingSetSize and maxWorkingSetSize have the value IntPtr(-1),
the function removes as many pages as possible from the working set of the specified process.
- maxWorkingSetSize IntPtr
-
The maximum working set size for the process, in bytes.
The virtual memory manager attempts to keep no more than this much memory resident in the process
whenever the process is active and available memory is low.
This parameter must be greater than or equal to 13 pages (for example, 53,248 on systems with a 4K page size),
and less than the system-wide maximum (number of available pages minus 512 pages).
The default size is 345 pages (for example, this is 1,413,120 bytes on systems with a 4K page size).
If both minWorkingSetSize and maxWorkingSetSize have the value IntPtr(-1),
the function removes as many pages as possible from the working set of the specified process.
- flags SetProcessWorkingSetSizeFlags
-
The flags that control the enforcement of the minimum and maximum working set sizes.
Boolean if the function succeeds,
otherwise.