File Error 94,10 Windows Extend version 9.1

We have an automated process which runs in the background processing files (using Extend 9.1 on Windows).  As each file is processed, many Vision version 5 files are accessed, and many Cobol programs called from an object library (called OMICS7).

After approximately 6500 files are processed, the runtime crashes with a file error 94,10 - which indicates the session is out of file handles.  The customer is running on Windows Server 2008, but the same behaviour exists on Windows 10 Pro.

We use a config file for the runtime, and the exact same behaviour occurs when MAX-FILES is set to 256, and when set to 16000.

Using a Process Manager to monitor file handles, when the file error 94 is raised, we see many (approx 2000) file handles open for the object library (OMICS7).  Curiously, we do not see these file handles earlier in the process, when only 3000 files have been processed, for example.

We've examined the Cobol code in depth and are satisifed that programs are being correctly canceled, files being correctly closed, etc.

Specific questions:
1) Does a file error 94 indicate no more FILE HANDLES as specified in MAX-FILES?

2) Does opening a bitmap image in a program count as a FILE HANDLE?  We use DESTROY to close these, but do we also need to CANCEL the call to W$BITMAP?

3) Is there any detail somewhere that could tell us more specifically what "counts" as a file handle for purposes of the file error 94, and how we can monitor those?

Any other suggestions re the file error 94 would be appreciated!

Thanks

Tony

  • For 1) the number of file handles is limited by the OS and also MAX-FILES.  If either of those limits are exceeded, an OPEN will return 94,10.

  • For 2), yes opening a bitmap image in a program will count as a FILE handle. But only as long as the runtime takes to open and read the file, and then the bitmap is closed. So this shouldn't count for the file handles opened.

    For 2), there is a program named handle.exe from sysinternals that can show the list of files that a process has open. I suggest getting this, and using it to determine what the runtime has open.

  • Verified Answer

    Thanks for the suggestions - it turned out to be a problem where a program was being called once for each process, several different bitmaps are loaded using W$BITMAP with each CALL, but most are DESTROYED before exiting the program.  One bitmap was NOT being destroyed (the handle wasn't destroyed using W$BITMAP), and after 6500 iterations, the file error 94 was raised.  The program was being canceled, so it seems as if the file handles for actual files were being correctly closed, but that the handle for the bitmap image that was not being destroyed, was not being released. Simply destroying the bitmap handle before exiting resolved the problem.