Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Too Many Files Open
Message
From
28/04/1998 07:36:48
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00095108
Message ID:
00095339
Views:
23
>>>I am getting a "Too Many Files Open" error when running an application written in VFP 5.0. The FILES statement in the CONFIG.SYS file is set to 40. I thought Windows 95 and Windows 95 applications ignored the FILES statement. Have I been mislead? Should I increase the FILES statement?
>>Completely remove the line or set higher.
>>Cetin
>
>Try: FILES = 100
> BUFFERS = 40

Setting the buffers this way is a -BIG- mistake; an incorrect value can radically change the conventional memory footprint of the underlying DOS for Win95/Win98, resulting in some interesting and annoying problems when running some 16 bit applications. The reasons for this are simple - Win95 by default attempts to load a segment of DOS into the HMA (the first 64K beyond the 1MB address mark. It will allocate buffers for real mode I/O (the BUFFERS= statement) in the HMA as well as long as there is enough room to allocate all the buffers there. Depending on the underlying DOS version, the number of buffers that can be loaded there will run somewhere between 32-38.

If there isn't adequate space to allocate buffers in the HMA, the buffers are moved to the top of the conventional memory address space. This is an all or nothing move - either all buffers are allocated in the HMA, or they all reside in the conventional memory address space. At 528 bytes/buffer, you end up eating over 20K of conventional RAM out of each VDM using a value of BUFFERS=40! Since 16 bit WinApps share a single VDM, this means that the base memory allocation for all 16 bit WinApps gets affected; you get silly 'Out of memory' errors more frequently with multiple 16 bit WinApps because of the way 16 bit apps attempt to allocate certain types of memory.

This also affects the ability to load the infinitely more important applications like DOOM in a VDM, since it affects their memory allocations, too... :-)

And now, the really bad news - unless you are forced to run in compatibility mode, where disk I/O goes through the BIOS and DOS interface rather than through a protected driver, the allocations of buffers has no effect on the Win95 file system's performance. Buffering and caching are managed by the 32 bit disk I/O system, and never touch the DOS buffer space in the HMA or conventional RAM with protected mode disk drivers loaded. The only times where the allocation of buffers to DOS is significant are (1) when disk I/O is forced to use a BIOS service because of incompatibility (some older disk compression and drive overlay software can prevent Win95 from using protected mode, but in almost all cases newer versions of the software is available, or the functionality isn't needed under Win95), (2) running in Safe Mode (no protected mode disk I/O subsystem is loaded, so all disk access is via the INT 13 interface) or (3) when running in Win95's single DOS session mode, which unloads all the Win95 functionality.

Ed
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform