zbatev Posted July 28, 2011 Posted July 28, 2011 (edited) Hi All, I've got an application that starts 8,000K memory usage according to the Task Manager but as time goes by it grows higher and higher. The structure is like this(this is not the actual code): I was monitoring the memory usage at random times and its like this: 9,856 K 10,220 K 11,216 K 11,220 K 12,156 K 12,984 K 12,988 K 13,860 K ...and this will continue to accumulate in time While 1 ;this is because this application run 24 hours $valueA = False While $valueA = False for $x = 1 to 10 if $monitorThis = $requiredValue then ;this portion will monitor the time $valueA = True exitloop endif next Wend if $valueA = true then ;do some stuff sleep(840000) ;14 minutes endif Wend Edited July 28, 2011 by zbatev
guinness Posted July 28, 2011 Posted July 28, 2011 (edited) Search for WinAPIEx.au3 by Yashied and the Function _WinAPI_EmptyWorkingSet() which "Removes as many pages as possible from the working set of the specified process." OR Call this Function in you .au3 to reduce the memory of the current process. Func _ReduceMemory() Local $aReturn = DllCall("psapi.dll", "int", "EmptyWorkingSet", "long", -1) If @error = 1 Then Return SetError(1, 0, 0) EndIf Return $aReturn[0] EndFunc ;==>_ReduceMemory Edited July 28, 2011 by guinness Synapsee 1 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
zbatev Posted July 28, 2011 Author Posted July 28, 2011 Wow, thanks a lot... Let me try that and I'll get back to you as soon as I'm done monitoring for improvements
guinness Posted July 28, 2011 Posted July 28, 2011 Is it a program you've designed or another process e.g. Opera.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
zbatev Posted July 28, 2011 Author Posted July 28, 2011 (edited) Is it a program you've designed or another process e.g. Opera.exe?Actually it is an automatic screen capture program that I made. We dont want to buy commercial version and the free version does not meet the requirements.My boss wants to get screen shots at these times in (mm:ss): 59:55, 00:00, 00:05 14:55, 15:00, 15:05 29:55, 30:00, 30:05 44:55, 45:00, 45:05I'm done with that but the problem is as I've mentioned the memory size accumulating over time.I'm currently testing your suggestions and see which one will work... Edited July 28, 2011 by zbatev
monoscout999 Posted July 28, 2011 Posted July 28, 2011 (edited) Hi All, I've got an application that starts 8,000K memory usage according to the Task Manager but as time goes by it grows higher and higher. The structure is like this(this is not the actual code): I was monitoring the memory usage at random times and its like this: 9,856 K 10,220 K 11,216 K 11,220 K 12,156 K 12,984 K 12,988 K 13,860 K ...and this will continue to accumulate in time While 1 ;this is because this application run 24 hours $valueA = False While $valueA = False for $x = 1 to 10 if $monitorThis = $requiredValue then ;this portion will monitor the time $valueA = True exitloop endif next Wend if $valueA = true then ;do some stuff sleep(840000) ;14 minutes endif Wend For me, one problem is the bad design of the loop, maybe it stucks in the "While $valueA = False" loop that have no sleep() this affect the CPU usage, i never run a script for so long time as a entire day, but you can try another method of scripting because there is something, maybe in the rest of the script that is not properly managed. My boss wants to get a screen shots at these times(in mm:ss): 59:55, 00:00, 00:05 14:55, 15:00, 15:05 29:55, 30:00, 30:05 44:55, 45:00, 45:05Are these times taken for the real clock time or times from the script start to run? Edited July 28, 2011 by monoscout999
guinness Posted July 28, 2011 Posted July 28, 2011 Another tip to add what monoscout999 said is look at AdlibRegister() if you want to call a Function every 14 minutes instead of Sleeping. 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
zbatev Posted July 28, 2011 Author Posted July 28, 2011 Hi guinness,I think it's working the memory usage has dramatically lowered to 800K.I also noticed one thing, each time I show GUISetState(@SW_SHOW) a hidden form GUISetState(@SW_HIDE), the memory usage accumulates.What i did now is applied the same concept as you suggested like:GUISetState(@SW_HIDE) _ReduceMemory()But I'm guessing I'm using the wrong flags @SW_SHOW and @SW_HIDE? Because I was thinking more like the visual basic Load 'Form' Unload 'Form'.
zbatev Posted July 28, 2011 Author Posted July 28, 2011 Another tip to add what monoscout999 said is look at AdlibRegister() if you want to call a Function every 14 minutes instead of Sleeping.'AdlibRegister()' --- I'm looking into this right now.
guinness Posted July 28, 2011 Posted July 28, 2011 A quick Example so you get an idea >> Global $iCount = 0 AdlibRegister("_Function", 3000) While 1 Sleep(100) If $iCount = 5 Then ; Just for testing purposes, this will Exit after 5 MsgBox()'s have been displayed. AdlibUnRegister("_Function") Exit EndIf WEnd Func _Function() MsgBox(64, "MsgBox() - " & $iCount + 1, "This is showing because the Function is called every 3 seconds.") $iCount += 1 EndFunc ;==>_Function 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
zbatev Posted July 28, 2011 Author Posted July 28, 2011 (edited) Hi monoscout999,Thank you for the criticism I appreciate it.For me, one problem is the bad design of the loop, maybe it stucks in the "While $valueA = False" loop that have no sleep() this affect the CPU usage, i never run a script for so long time as a entire day, but you can try another method of scripting because there is something, maybe in the rest of the script that is not properly managed.Are these times taken for the real clock time or times from the script start to run?Yes I was hesitant to put Sleep() function since I might miss the time requirement, which is to the second:59:55, 00:00, 00:05 14:55, 15:00, 15:0529:55, 30:00, 30:0544:55, 45:00, 45:05And yes this are real clock time NOT from when the script start to run.Do you have any other suggestion where I can hit those specified time without missing one? The only solution I could think of is not pushing a Sleep function even for a fraction of the time, and it is actually working(sacrificing PC workload I think). Edited July 28, 2011 by zbatev
zbatev Posted July 28, 2011 Author Posted July 28, 2011 (edited) Hi guinness & monoscout999, I think I've manage to eliminate the weakness of my design by using the _ReduceMemory() and AdlibRegister(), I've reconstructed my design into this form: CaptureScreen() Func CaptureScreen() While 1 $valueA = False While $valueA = False for $x = 1 to 10 if $monitorThis = $requiredValue then ;this portion will monitor the time $valueA = True exitloop endif next Wend if $valueA = true then ;do some stuff _ReduceMemory() AdlibRegister("CaptureScreen",840000) ;calls itself after 14 minutes endif Wend EndFunc I still have an infinite loop without a Sleep() or similar function BUT that infinite loop will only run for a maximum of 1 minute every 15th minute, the _ReduceMemory() will eliminate unecessary/unused resources and AdlibRegister tooks care of the PC workload. Thank you very much for scouting problems like this and sharing your genius! Edited July 28, 2011 by zbatev
monoscout999 Posted July 28, 2011 Posted July 28, 2011 i think the weaknes is still there but if it work well, then it is ok
guinness Posted July 29, 2011 Posted July 29, 2011 Those loops do look a little excessive. 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
JohnOne Posted July 29, 2011 Posted July 29, 2011 I doubt the loops are causing the problem, and the reduce memory workaround is really a cheap imitation of a fix.I suspect the problem lies elsewhere in your code, probably your screencapture setup. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
smartee Posted July 29, 2011 Posted July 29, 2011 I agree with JohnOne I keep imagining some bitmap and graphics objects left undestroyed, I think the puppet is still under the table. Maybe you want to show us the puppet the rest of your code ie. ?
monoscout999 Posted July 29, 2011 Posted July 29, 2011 I agree with JohnOne I keep imagining some bitmap and graphics objects left undestroyed, I think the puppet is still under the table. Maybe you want to show us the puppet the rest of your code ie. ?I bet for this.. the Bitmap object created by the screenshot is not being deleted.
zbatev Posted July 29, 2011 Author Posted July 29, 2011 (edited) Thanks guys actually everything is working fine right now but I will still do some more math so I will eliminate 1 or 2 loops... I'll keep this thread updated when I've got something new.... And yes I still think the puppet is still under the table but for now they have to settle with it while I'm working on improving the application. There are some things that need to be fix like the AdlibRegister is inside a loop, I think I have to let it out. From the looks of it, its really messy I've got some cleaning to do. Edited July 29, 2011 by zbatev
ChrisL Posted July 29, 2011 Posted July 29, 2011 Actually it is an automatic screen capture program that I made. We dont want to buy commercial version and the free version does not meet the requirements.My boss wants to get screen shots at these times in (mm:ss): 59:55, 00:00, 00:05 14:55, 15:00, 15:05 29:55, 30:00, 30:05 44:55, 45:00, 45:05I'm done with that but the problem is as I've mentioned the memory size accumulating over time.I'm currently testing your suggestions and see which one will work...Empty working set pushes the memory on to the pagefile, if you select show pagefile in task manager you'll probably notice this getting bigger rather than the physical memory, any memory items required then have to be pulled back out from the pagefile when needed, seeing as you say its a screen grabber then there will be a GDI or GDI+ object that your not disposing of which is taking up the memory, I have some GDI+ scripts that create hundreds of objects and destroy them over a period of time and the memory is totally stable if you dispose of everything propperly [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire
masvil Posted October 18, 2016 Posted October 18, 2016 The _WinAPI_EmptyWorkingSet() method works good here. Is there a similar way to empty/reduce the virtual memory size as well?
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