GEOSoft Posted May 17, 2009 Share Posted May 17, 2009 it is better to use GetCurrentProcess for the own Process and not OpenProcess Func _ReduceMemory($ProcID = 0) ; Original version : w_Outer ; modified by Rajesh V R to include process ID ; modified by Prog@ndy to include process handle If $ProcID = 0 or ProcessExists($ProcID) = 0 Then ; No process id specified or process doesnt exist - use current process instead. Local $ai_GetCurrentProcess = DllCall('kernel32.dll', 'ptr', 'GetCurrentProcess') Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'ptr', $ai_GetCurrentProcess[0]) Return $ai_Return[0] EndIf Local $ai_Handle = DllCall("kernel32.dll", 'ptr', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $ProcID) Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'ptr', $ai_Handle[0]) DllCall('kernel32.dll', 'int', 'CloseHandle', 'ptr', $ai_Handle[0]) Return $ai_Return[0] EndFuncGood work. Based on the link thet SmOke_N supplied, starting with Windows 7 psapi.dll is not used at all. It just uses kernel32.dll for everything so you may want to look into mods based on that. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
KaFu Posted June 3, 2009 Share Posted June 3, 2009 (edited) Based on the link thet SmOke_N supplied, starting with Windows 7 psapi.dll is not used at all. It just uses kernel32.dll for everything so you may want to look into mods based on that.So I assume this should work for WIN7? Have no system at hand to test . Oh, and rereading the article, has anyone an "Windows Server 2008 R2" at hand to check the Fileversion of "WinVer.exe"?Edit:Removed code because it crashed on WIN7 Edited June 12, 2009 by KaFu  OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 3, 2009 Moderators Share Posted June 3, 2009 I'm quite sure the psapi.dll calls are backwards compatible. Win7 does have psapi.dll, it's just stated that the functions are in kernel32 dll now. I guess it's safer to do it this way, but I seriously doubt they'll break all the 32bit apps out there by removing the dll and or it's compatibility. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
herewasplato Posted October 15, 2009 Share Posted October 15, 2009 Some error checking added by Prog@ndy for this thread: http://www.autoitscript.com/forum/index.php?showtopic=103693 Func _ReduceMemory($ProcID = 0) ; Original version : w_Outer ; modified by Rajesh V R to include process ID ; modified by Prog@ndy Local $ai_Return, $ai_Handle If $ProcID <= 0 Then ; No process id specified - use current process instead. $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'ptr', -1) If @error Then Return SetError(1, 0, 0) Return $ai_Return[0] EndIf $ProcID = ProcessExists($ProcID) If $ProcID = 0 Then Return SetError(2, 0, 0) $ai_Handle = DllCall("kernel32.dll", 'ptr', 'OpenProcess', 'dword', 0x1f0fff, 'int', False, 'dword', $ProcID) If @error Or $ai_Handle[0] = 0 Then Return SetError(3, 0, 0) $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'ptr', $ai_Handle[0]) If @error Then DllCall('kernel32.dll', 'int', 'CloseHandle', 'ptr', $ai_Handle[0]) Return SetError(4, 0, 0) EndIf DllCall('kernel32.dll', 'int', 'CloseHandle', 'ptr', $ai_Handle[0]) Return $ai_Return[0] EndFunc ;==>_ReduceMemoryThanks Prog@ndy [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Gogeta70 Posted October 26, 2009 Share Posted October 26, 2009 forgot to close the handle: Func _ReduceMemory() Local $ai_GetCurrentProcessId = DllCall('kernel32.dll', 'int', 'GetCurrentProcessId') Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $ai_GetCurrentProcessId[0]) Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0]) DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0]) Return $ai_Return[0] EndFunc I'm a little confused. In the dllcall "OpenProcess" you have: 'int', 0x1f0fff However, when i look at MSDN, it says that it should be a DWORD value. Also, 0x1f0fff is not listed as a process access flag HERE So, what's with that? I'm just trying to understand. Link to comment Share on other sites More sharing options...
wraithdu Posted October 26, 2009 Share Posted October 26, 2009 (edited) Don't worry about things you don't understand. For all intents, int and dword are equivalent here. That value specifies PROCESS_ALL_ACCESS, which is unecessary overkill anyway. You only need PROCESS_QUERY_INFORMATION and PROCESS_SET_INFORMATION and PROCESS_SET_QUOTA. Change the parameter to 'dword' and 0x0700. Edited October 26, 2009 by wraithdu Link to comment Share on other sites More sharing options...
rajeshontheweb Posted October 26, 2009 Share Posted October 26, 2009 quite interesting, few things got way beyond my depth in dll / process handling knowledge, thats why i had to remain silent :-) one thing to comment is about win 7 - as mentioned, they have put them in kernel dll file and not have removed it yet but there is all chances it gets ignored anymore or in case of errors it may not be supported. probably we will wake this thread again when we face errors beyong win7 and also, we need to get it tested in all 6 editions of win7 (there should be no errors assuming current case) if some gets hold of them ... Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet Link to comment Share on other sites More sharing options...
Merrik Posted May 30, 2011 Share Posted May 30, 2011 (edited) I ran into a situation where I needed to make sure the Dlls were opened and closed in the function, Func _ReduceMemory($ProcID = 0) ; Original version : w_Outer ; modified by Rajesh V R to include process ID ; modified by Prog@ndy ; Modified by Merrik Local $ai_Return, $ai_Handle Local $DllK = DllOpen("kernel32.dll") Local $DllP = DllOpen("psapi.dll") If $ProcID <= 0 Then ; No process id specified - use current process instead. $ai_Return = DllCall($DllP, 'int', 'EmptyWorkingSet', 'ptr', -1) If @error Then Return SetError(1, 0, 0) Return $ai_Return[0] EndIf $ProcID = ProcessExists($ProcID) If $ProcID = 0 Then Return SetError(2, 0, 0) $ai_Handle = DllCall($DllK, 'ptr', 'OpenProcess', 'dword', 0x1f0fff, 'int', False, 'dword', $ProcID) If @error Or $ai_Handle[0] = 0 Then Return SetError(3, 0, 0) $ai_Return = DllCall($DllP, 'int', 'EmptyWorkingSet', 'ptr', $ai_Handle[0]) If @error Then DllCall($DllK, 'int', 'CloseHandle', 'ptr', $ai_Handle[0]) Return SetError(4, 0, 0) EndIf DllCall($DllK, 'int', 'CloseHandle', 'ptr', $ai_Handle[0]) Return $ai_Return[0] DllClose($DllK) DllClose($DllP) EndFunc ;==>_ReduceMemory so I thought I would add this part in. Edited May 30, 2011 by Merrik Link to comment Share on other sites More sharing options...
guinness Posted May 30, 2011 Share Posted May 30, 2011 I don't this is a problem or required about closing the DLL, why not use _WinAPI_EmptyWorkingSet() in WinAPIEx.au3 by Yashied. UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Merrik Posted May 30, 2011 Share Posted May 30, 2011 Do you have an example you would like to share using _WinAPI_EmptyWorkingSet? :-) Link to comment Share on other sites More sharing options...
guinness Posted May 30, 2011 Share Posted May 30, 2011 An Example is in the Help File provided by Yashied. All you do is call the Function by using _WinAPI_EmptyWorkingSet() if you want to use the running EXE. UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Merrik Posted May 30, 2011 Share Posted May 30, 2011 Do you have an example you would like to share using _WinAPI_EmptyWorkingSet? :-)Cool! This was the first time I've seen this. Looks good. I will test. Do you know it works on Windows 7? Link to comment Share on other sites More sharing options...
guinness Posted May 30, 2011 Share Posted May 30, 2011 Cool! This was the first time I've seen this. Looks good. I will test. Do you know it works on Windows 7?Yeh it does, x32 & x64. UDF List:  _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Unsigned Posted October 3, 2011 Share Posted October 3, 2011 All this does is force Windows to page out working memory to the pagefile. It doesn't "free" any memory, and may in fact have performance hits for a running application, because it forces a hard drive access twice (once when you call it, once again when that page is needed again.) Windows will automatically do this for you if your free memory drops to critical. That's one reason why your machine is so much slower in those situations, because of all those page faults. The only situation this would be useful is in a long-running, little-executing process, such as a background service, that spends most of it's time sleeping. In those cases, this call acts as something of a "OK I'm idle, you can put my memory away to the hard drive until I want it again." Using this in a foreground application as a means to artificially keep the physical memory size down is just . Link to comment Share on other sites More sharing options...
Yashied Posted October 3, 2011 Share Posted October 3, 2011 (edited) Typically, after calling this function, memory usage does not exceed 30-40% of the size that initialized by AutoIt. For example: #Include <WinAPIEx.au3> _WinAPI_EmptyWorkingSet() While 1 Sleep(1000) WEnd 664 KB vs. 10.184 MB (without _WinAPI_EmptyWorkingSet()) Anyway, this function should be used wisely. Edited October 3, 2011 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
money Posted October 4, 2011 Share Posted October 4, 2011 Use it only at the very beginning and then let windows do the rest. _WinAPI_GetCurrentProcessID() and @AutoItPID works the same yes? Link to comment Share on other sites More sharing options...
Unsigned Posted October 4, 2011 Share Posted October 4, 2011 The point was that it doesn't actually lower memory usage, just change the location at which those memory pages are stored. Windows will automatically page out as necessary if your physical memory approaches critical. Why cut your performance at all, for 10MB that you don't need anyway? If you did, it would already be paged out. . Link to comment Share on other sites More sharing options...
money Posted October 4, 2011 Share Posted October 4, 2011 @Unsign: Force thrashing? It makes my HD purr like a kitten. @Yashied '0x001F0FFF' VS '0x00000700' as wraithdu said. Also DllCall('kernel32.dll', 'ptr', 'OpenProcess',... vs. _WinAPI_OpenProcess(... Just late night copypasta or reasoning behind this? Link to comment Share on other sites More sharing options...
money Posted October 4, 2011 Share Posted October 4, 2011 I use this function in loop so my memory would stay low. LOL. Link to comment Share on other sites More sharing options...
Yashied Posted October 4, 2011 Share Posted October 4, 2011 I use this function in loop so my memory would stay low. LOL.Delusion... My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
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