GeorgeP Posted January 24, 2024 Posted January 24, 2024 I have been using Autoit for many years now and have started to have issues with some of my compiled scripts staying in memory. I compile all my scripts to exe and then run them from a scheduler. My desktop PC (Windows 10) runs a multitude of scripts every day. Most are fine but some (they all relate to one project and the exe's are all in the same folder) hang up and stay in memory. I have image files on our FTP server that need to be downloaded, renamed then put back up onto the FTP server. Always when running a process that requires FTP like this I use a "starter" script (compiled) that checks to see if the actual FTP script (exe) is in memory, if it is it doesn't start it again, if not then it starts it. The reason for this is that I don't want two copies of the same script in memory competing for the exact same files. Even my simple starter scripts hang in memory - an example is below ;starter script for Nelson FTP Put if ProcessExists("NelsonFTPFiles.exe") then Exit Else Run("C:\Apps\Nelson Images\NelsonFTPFiles.exe") sleep(5000) Exit EndIf This script works fine, if the FTP process is not in memory it starts it - the problem is sometimes it doesn't exit and be removed from memory hence looking in task manager I see This is not just these starter scripts, my actual FTP process script stays in memory which means when the starter script runs again it will not start the main FTP process script - because it is still in memory. I have several projects running very similar scripts for downloading files from the FTP server, checking folders on our servers to count how many images have been downloaded in last 24 hours, plus many other processes. All these others work fine and do not stay in memory but scripts from this one folder (project) often stay in memory. Anyone got any ideas why this would happen? Thanks George
Danp2 Posted January 24, 2024 Posted January 24, 2024 Since it only seems to happen with scripts in one folder, have you looked into thing like rights issues, A/V software exclusions, system logs, etc? Latest Webdriver UDF Release Webdriver Wiki FAQs
GeorgeP Posted January 25, 2024 Author Posted January 25, 2024 Danp2, thanks for that suggestion I will check it out next week as this is my work desktop that I am using for these jobs and plenty of others. I am not sure why rights issue should be causing exe's started from this folder to remain in memory - I would have thought that once they reached the last statement or an Exit command they should be unloaded from memory. I can open the Task Manager and end the tasks without issue. Also, just realised that these exe's can run for several weeks before they start staying in memory. My biggest issue is with the script that picks up my files from our FTP server, as mentioned before I use a starter script to start it which checks to make sure it is NOT in memory - if it is I don't start a new instance. This problem of exe's hanging caused me problems over the Xmas break but for all of this month it has worked fine until a couple of days ago. Very confusing.
junkew Posted January 27, 2024 Posted January 27, 2024 Maybe extend the scriptlogic Timestamp when it started and kill when running longer then n hours Have the scripts provide some healthcheck info every n minutes which you could also use to kill a process .... FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
KaFu Posted January 28, 2024 Posted January 28, 2024 On 1/24/2024 at 9:57 PM, GeorgeP said: I have image files on our FTP server that need to be downloaded, renamed then put back up onto the FTP server. Why not just use _FTP_FileRename()? Also are you sure that you close the FTP connections properly? Might hang otherwise. Hard to tell anything without knowing your script. 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 (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Zedna Posted January 29, 2024 Posted January 29, 2024 Also you may set-up property of job in scheduler "end task when it's running longer then ...". In your case I would add some logging (to file) capability into your script to see where it hanged ... Resources UDF ResourcesEx UDF AutoIt Forum Search
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