Supprime autant de pages que possible de l'espace de travail du processus spécifié
#include <WinAPIProc.au3>
_WinAPI_EmptyWorkingSet ( [$iPID = 0] )
$iPID | [optionnel] Le PID du processus. Par défaut, (0) est le processus actuel. |
Succès: | Retourne 1. |
Échec: | Retourne 0 et définit @error <> 0. |
Consultez EmptyWorkingSet dans la librairie MSDN.
#include <MsgBoxConstants.au3> #include <WinAPIProc.au3> #include <WinAPIShPath.au3> Run(@SystemDir & '\taskmgr.exe') Sleep(1000) MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), 'Étape 0', 'Montre la mémoire utilisée par le processus "' & _WinAPI_PathStripPath(FileGetLongName(@AutoItExe)) & '" (' & @AutoItPID & ').') ; Alloue de la mémoire pour créer un tableau Local $aData[1000000] For $i = 0 To UBound($aData) - 1 $aData[$i] = 'AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying "runtimes" required!' Next MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), 'Étape 1', 'Alloue de la mémoire pour créer un tableau') ; Vide l'espace de travail _WinAPI_EmptyWorkingSet() MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), 'Étape 2', 'Libère l''espace de travail') ; Lit les données du tableau For $i = 0 To UBound($aData) - 1 If $aData[$i] Then ; quelque chose EndIf Next MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), 'Étape 3', 'Lit les données du tableau') ; Libère l'espace de travail _WinAPI_EmptyWorkingSet() MsgBox(BitOR($MB_ICONINFORMATION, $MB_SYSTEMMODAL), 'Étape 4', 'Libère l''espace de travail')