Posted onFebruary 27, 2019 (Revised December 8, 2025)
Our old VB6 program leaks memory on every request and it can fail or crash multiple times a day. We need to re-write it but we don’t have budget right now so I’m looking at AlwaysUp to run it all the time. What settings should I use to keep it running?
— Anonymous
Hi. We have many customers who have turned to AlwaysUp to keep legacy applications going. Here is what we recommend for your situation:
Restart your VB6 program on high memory use
AlwaysUp is designed to launch your application as a Windows Service when your computer boots, but it can perform several “monitoring tasks” after that initial event.
One such task is to watch how much memory your application is using. You can setup AlwaysUp to stop and restart your application when its memory usage crosses a specific threshold.
The setting is available on AlwaysUp’s Monitor tab:
The default threshold is 512 MB. Is that too much (or too little) for your VB6 application?
We suggest using the Task Manager to get an idea of how much memory your application typically consumes. Use that information to set the threshold appropriately.
Note: Because AlwaysUp is a 32-bit application, the maximum memory threshold you can set is 4 GB. You will have to configure the CheckMemorySize64 sanity check plugin to exceed that limit. Please get in touch if you need help doing that.
Preempt memory problems by restarting VB6 (or rebooting the PC) once per day
While restarting on high memory is a good safety net, it is unpredictable. Your customers may notice a brief interruption if a restart occurs at a busy time.
Consider instead, a proactive daily restart — to flush the accumulated memory leaks and start your VB6 program afresh. With a clean slate, your application should run reliably for some time before the excessive leaks bog it down again.
You can configure a daily restart on the Monitor tab as well. Here we have asked AlwaysUp to stop and restart the application every day at 2 AM:
Note that you can:
Reboot the entire machine. This may be necessary if you find that restarting the application alone doesn’t clear the problems.
Restart/reboot only when certain conditions are met. For example, you can skip the restart if the application is busy (i.e. using CPU), or if it hasn’t used much memory yet.
Whatever works for your situation!
Want to restart your Visual Basic program more than once per day? This article reviews some alternatives.
Those two settings should help. Best of luck with your application!
The Schedule service implements part of the Windows Task Scheduler — an important operating system component. The service’s display name is Task Scheduler and it runs inside the service host process, svchost.exe:
The Schedule service is responsible for automatically launching executables, batch files and scripts (i.e. tasks) on your PC, without human intervention. It can start each task:
At a fixed day and time (e.g. “every night at 11 PM”)
When someone logs on to the computer
When the system is booted
When the machine becomes idle
When a specific system event occurs
The pool of tasks to be run by the service is managed by the Task Scheduler application. Find it in the Control Panel (it may be called “Scheduled Tasks”), or launch the program directly by running taskschd.msc.
From the main window, navigate into the Task Scheduler Library to see all the tasks that the Schedule service will run. Here we see a task that updates the Dropbox cloud storage software — set to run every day at 12:48 PM:
What happens if I stop the Schedule service?
No scheduled tasks will run when the service is stopped.
This may be of little consequence on a machine with a handful of optional jobs, but it will be a catastrophe on a server that relies on scheduled tasks to perform mission-critical maintenance.
Be sure to understand which camp you are in before stopping the Schedule service!
The “Stop” button is disabled. How can I stop the Schedule service?
If you look closely at the service’s screenshot, you will notice that the Stop button is disabled — indicating that the service cannot be stopped.
And even the versatile NET STOP command run as an administrator will fail, citing insufficient rights (“Access is denied”):
Evidently Microsoft is telling us, ever so gently, that we shouldn’t stop the service. 🙂
However — if you are hell-bent on ignoring Microsoft’s advice — there is a way forward. You can use our free Service Security Editor tool to rejigger permissions and grant yourself the ability to stop the service.
In their guidance on disabling system services on Windows Server 2016, Microsoft does not classify the Task Scheduler service as “Do Not Disable”. Indeed, they punt on guidance altogether, commenting that “the impact of disabling the service has not been fully evaluated”. However, they do recommend that the Schedule service remains enabled.
Reboot your computer. Hopefully you have fallen victim to a temporary glitch and sanity will be restored when the operating system next starts.
Manually run Windows Update. If you’re lucky, the Microsoft Windows engineers have already found and fixed the problem with their software.
Seek expert help. Start with a google search for a quick fix; move on to your local administrator if no resolution is forthcoming.
Reinstall Windows. You may have to start over from scratch if nothing else works… 🙁
Questions? Problems?
If you would like to know more about the Windows Schedule service, or you have a specific problem, please feel free to get in touch. We will do our best to help you!
I’m using AlwaysUp to run Google Backup and Sync. I only receive emails when I manually stop and start the service — NOT WHEN my server restarts. I’m positive that all the settings are correct after double checking with one of my other installations that works fine (I have 2 licenses). What is the problem?
— Hassan Asif
Hi Hassan, sorry to hear of the trouble! We have seen this with one customer before, so we have a potential fix.
The problem: AlwaysUp is starting before important Windows Services are ready
Ever been to a Black Friday sale? It’s like that when your PC starts — controlled chaos.
The eager shoppers are the Windows Services configured to start automatically at boot. Windows launches them as soon as possible, in well-defined waves, but as new processes fight for your computer’s precious resources (CPU, RAM, etc.) it is impossible to predict when any one service will actually be ready.
For example, let’s look at the DHCP Client service. It registers an IP address for your computer — an important step that must be completed before any network operations can succeed. But since the DHCP service is launched along with several other (equally important) services, it may be available after 10 seconds today while tomorrow it may take 12 seconds to be ready. Each boot is different, and you cannot know precisely when the service will be primed.
Since you followed our tutorial, the AlwaysUp service running your Backup and Sync is configured to participate in the “mad rush” at boot. This is usually fine, but in your case I suspect that AlwaysUp is starting up too soon — before one of the important services required for sending email is fully prepared.
We have seen this before, on a beefy machine with 16 processors and 32 GB of RAM. Is the computer experiencing the problem much faster than the one that sends email properly?
Fortunately we were able to come up with a remedy…
The solution: Delay AlwaysUp, to give email-related Windows Services more time to get ready
If our diagnosis is correct, then the fix is to make the AlwaysUp service start only after all important networking and email services are ready.
But since there is no way to know exactly when all those services will be ready, the best we can do is to remove AlwaysUp from the “mad rush” and have it start a couple of minutes later. Luckily Microsoft (and AlwaysUp) has already provided a setting that does exactly that!
To delay the launching of your AlwaysUp Backup and Sync service:
Start AlwaysUp.>
Edit your application (by selecting Application > Edit/View).>
On the General tab, change the Start the application setting to Automatically, but shortly after the computer boots:
Click Save to record your change.>
With that setting in place, Windows will fire up the Backup and Sync service 1-2 minutes after boot — well after the mad rush. That should be enough time for the critical services to start.
And the delay shouldn’t be a problem for Backup and Sync since it isn’t required the “instant” that your machine starts. No rush there.
Posted onFebruary 4, 2019 (Revised January 7, 2023)
Are you running Dropbox as a Windows Service? Do you rely on Dropbox to operate unattended in the background, synchronizing your important files 24×7?
If so, then be on the lookout for the new Selective sync warning dialog — a popup window that requires your confirmation whenever a file is deleted. Left unanswered, it will stop Dropbox dead in its tracks and prevent all future synchronization!
Checking the Don’t ask me this again box will eliminate the warning going forward — a welcome capability. It’s certainly an improvement over having to dismiss the window on each delete! Thanks you, Dropbox developers, for providing the checkbox.
But having the only control in the warning itself means that we can only make the “don’t ask” selection when the warning is triggered. And who knows if we’ll be around then?
Unfortunately Dropbox (and AlwaysUp) user howeboards has fallen victim to the prompt. He describes the situation in this support forum post:
On the server, the Dropbox account “A” as configured under AlwaysUp in “service” mode is configured to run under the same Windows administrator account as what it would be if one was to log in to the server. It is still the same user account that it is “running as” in either case with the same configuration and the same Dropbox directory location.
Because this server is hosted in Azure, is taken off-line overnight and/or might reboot, it is not ideal to have to log in to the server to make sure Dropbox is running. So the permission issue I mentioned is because an automated process deleted a file or moved a file, and no one was there to click a dialog regardless if it was running in the foreground or the background. To work around this, I have had to manually restart Dropbox in that user’s foreground session to click the dialog to make it remember it. That is just plain crazy.
Crazy indeed! We can surely do better.
Any Dropbox developers reading? Please implement one of these alternatives for future warnings
In addition to the graphical controls in the warnings, can you please include viable options for those of us running Dropbox unattended?
Here are some suggestions to avoid those unwelcome prompts:
Add a specific option to the settings window
Add a new checkbox labeled “Don’t warn me when deleting files”. Checking it would eliminate the warning without having to interact with Dropbox at some obscure time.
Add a general “Don’t warn me” option to the settings window
This broad setting would apply to all current and future warnings — not just the specific one raised in this article.
Such a powerful control may seem reckless, but I can assure you: Many of your customers would happily avoid any confirmation that has the power to cripple synchronization for several hours!
Introduce (and document) a registry value that governs the warning
This approach puts technical folks in the driver’s seat, but with zero impact (and complexity) on the user interface.
Well, today we can offer you a third option — one that doesn’t rely on additional software, like the Task Scheduler.
By leveraging the powerful Sanity Check feature — which allows you to plug in your own failure detection system — we can get AlwaysUp to close and restart your program every few hours.
Here is an example of how to set that up:
Example: Restart OneDrive every 4 hours
For this example, we’ll work with Microsoft OneDrive — already installed as a Windows Service on our Windows 10 machine.
First, create a simple batch file with these two commands:
@echo off exit 1
Save the file in your AlwaysUp installation folder, C:\Program Files (x86)\AlwaysUp. We have named our batch file “SignalRestartSanityCheck.bat”.
Start AlwaysUp.
Select Application > Edit/View to open OneDrive in AlwaysUp.
Switch to the Monitor tab.
Check the Whenever it fails a “sanity check” box mid-way down the page, and click the triple-dots button on the right:
In the window that comes up, enter the full path to the batch file you created in the Run field.
And set the Every controls to 240 minutes (i.e. 4 hours):
Confirm and save all your changes.
Now whenever we start OneDrive as a service with AlwaysUp button (or the computer is rebooted), this sequence will play out:
AlwaysUp starts OneDrive.
After 4 hours have passed, AlwaysUp runs the batch file (sanity check).
The batch file exits with 1, signaling to AlwaysUp that OneDrive should be stopped.
AlwaysUp stops OneDrive.
AlwaysUp restarts OneDrive (as specified on the Restart tab).
And the cycle repeats… (go to step 2)
UPDATE: Automatically restart your application every 2, 4, 6, 8 or 12 hours — directly from AlwaysUp
AlwaysUp version 11.8 introduced the ability to restart your application much more frequently.
The new periods are available in the Every setting on the Monitor tab. Expand the drop-down to select the desired time frame: