rasim Posted November 23, 2008 Posted November 23, 2008 (edited) jackit how do i implement it?Example: #include <GuiConstantsEx.au3> $hGUI = GUICreate("Test", 300, 200) GUISetState() _ReduceMemory(@AutoItPID) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Reduce memory usage ; Author wOuter ( mostly ) Func _ReduceMemory($i_PID = -1) If $i_PID <> -1 Then Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID) Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0]) DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0]) Else Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1) EndIf Return $ai_Return[0] EndFunc;==> _ReduceMemory() Edited November 23, 2008 by rasim
rasim Posted November 23, 2008 Posted November 23, 2008 So i can place _ReduceMemory(@AutoItPID) where ever i need to reduce memory right?Yes
FireFox Posted November 23, 2008 Posted November 23, 2008 (edited) Yes Hi,Ive make little script for auto reduce memory of all process, avaliable here : PMD auto Edited November 23, 2008 by FireFox
ProgAndy Posted November 23, 2008 Posted November 23, 2008 To reduce your the memory usage of your own Script, better use _ReduceMemory(-1), so it doesn't has to call OpenProcess/CloseProcess. *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes
rasim Posted November 23, 2008 Posted November 23, 2008 To reduce your the memory usage of your own Script, better use _ReduceMemory(-1), so it doesn't has to call OpenProcess/CloseProcess.Yes, you are right
FireFox Posted November 23, 2008 Posted November 23, 2008 _ReduceMemory(-1) is the same thing as _ReduceMemory(@ScriptName) ?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now