MSDOS batchfiles - There is not enough free memory to run this program

Every day after Directory Opus has been running for a few hours, I start to get the following error whenever running any MSDOS batchfile from within Directory Opus, or from any of the custom command/scripts I've added to the menu bar (which seem to be stored as batchfiles in the temp directory listed in the error message). The example error is from a directory lister command that I added to the menu bar.

memory

All batch files run fine for a few hours, then any batch file run will throw this error until I exit and restart Directory Opus. After restarting, everything runs fine for a few hours and then rinse, repeat.

Currently using v12.31 Build 8459, but this has been occurring for years, so likely through several versions - I'm just now taking the time to inquire about it.

Any thoughts on what could be causing this?

1 Like

How much memory is free on the machine?

If memory is low, which processes are using it?

What commands are being run in the batch files?

IIRC XCOPY fails with an "insufficient memory" error when the path plus filename is longer than 254 characters. An incorrect error message if you ask me, but that would be down to MS to fix. I wouldn't hold my breath though, I think that error's been around a while. So if it's that triggering the error, you might have to workaround it.

If it's not that, have you been able to narrow down to the particular batch file / command that causes the error?

Is it possible to run that particular batch file / command run successfully outside of the normal flow?

Does that particular batch file / command fail after x iterations or the first attempt?

I'd try and replicate the issue outside of DOpus first to see if it is actually a DOpus issue or a Windows one.

1 Like

At the time of my posting there was 32% memory used of 128GB total, so it doesn't appear to be an actual low memory issue.

Thanks for the suggestions. Once the error starts it will occur with any batch file, not just a specific one. It can be something as simple as a batch file with a single DIR>list.txt command or something much more complicated and it gives the same not enough memory result.

One other thing to note is that the error appears when I run the batch file (i.e. double-click the actual *.bat file) from within DOpus. If I run the same batch file from the windows CMD terminal it will execute fine.

If you open Task Manager and go to the Details tab, are there lots of cmd.exe processes sitting around in the list?

If there are, it might be running into a limit on how many the system allows at once.

And if those processes seems to be building up while using Opus, one possibility is that you have a button or script that you're using and it runs something in a way that doesn't close the cmd.exe at the end. (I don't think anything built-in would do that, but there are a few ways it could happen with custom commands/scripts, if they don't run things in the proper way.)

Sorry for the delay in the reply - the error just started occurring again now.

Currently there is only one cmd.exe present in the details tab.

The same behavior is present - running a batch from within DOpus throws the memory error, but when running it from the command line it executes fine.

copy

Edit: forgot to mention that it also runs fine from the standard windows file explorer

I have the same problem and it has nothing to do with memory (I have loads of free memory). I try to double-click on a batch file within DOpus and it throws the error. If I then open the same file folder within Windows File Explorer and double-clicking the same batch file it runs, no problem (no memory errors and the batch file runs fine from Windows File Explorer). This same issue happens with executables as well sometimes (like trying to start up a program from within DOpus). This has been going on for a year or so (I don't remember) but I have just used Windows File Explorer as a workaround when these out of memory errors start appearing in DOpus.

Maybe antivirus is blocking some programs from launching some things and not other programs/things?

There are a lot of bad antivirus out there these days (very much including Defender) and they don't always tell you they're blocking things properly (or at all).