Jump to content

Recommended Posts

Posted

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

image.png.68c5132a190422773a4747d623f5132d.png

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

Posted

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.

Posted
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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...