PRB: Not Enough Space for EnvironmentLast reviewed: July 23, 1997Article ID: Q107174 |
3.10 3.00
WINDOWS
kbprg kbprb
The information in this article applies to:
SYMPTOMSWhen a Windows-based application is started, it fails to load. While running under the debug version of Windows, one or both of the following debug messages are displayed on the debug terminal:
LocalAlloc Failed -or- GlobalAlloc FailedThen, Windows generates the following unrecoverable application error (UAE): "Not enough space for Environment."
CAUSEThe initial size specified for the application's local heap in the DEF file is too small to contain the local allocation for the environment.
RESOLUTIONWhen the Windows loader loads an application, it also stores a copy of the MS-DOS environment strings (such as the PATH string, and so forth) in the application's DGROUP. In general, the space needed to store this environment table could be around 200 to 300 bytes, but it could vary depending on the environment variables in the system. The loader will try to allocate space for the environment table using LocalAlloc(), and this call will fail if there is not enough space in the local heap. In such a case, Windows automatically tries to expand the local heap by doing a Gloabal(Re)Alloc. Because the maximum size for the DGROUP is 64K, the GlobalAlloc will fail if the loader tries to grow the DGROUP beyond the 64K limit. This will happen when the size of the DGROUP is close to the limit of 64K and there is not enough space in the application's DGROUP for Windows to expand the local heap in it. In such a case, the application's DGROUP must be cleaned up to allow more space for the local heap. A few ways to do this are:
|
Additional reference words: 3.10 gpf gp-fault gp fault
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |