PRB: R6009: "Not Enough Space for Environment" When Heap FullLast reviewed: July 18, 1995Article ID: Q63382 |
The information in this article applies to:
SYMPTOMSAn attempt to run an application fails and the following message appears on the screen:
R6009: Not Enough Space For Environment CAUSEAfter the application loads into memory, this error occurs when the application is unable to load a copy of the environment and the argument list into the near heap.
RESOLUTIONTo work around this problem, perform one of the following four steps:
MORE INFORMATIONIn an application developed in standard Microsoft C, the _setargv() and _setenvp() functions attempt to set up the argument vector and the environment vector, respectively. Each of these vectors is allocated from the near heap. In the near heap is full, or nearly full, the functions are unable to set up the vectors and the R6009 run-time error occurs. To prevent the error, substitute a null function for the _setargv() and _setenvp() functions to prevent the near heap allocation from taking place. The following FORTRAN code example performs this task. Specify the /NOE linker option switch to prevent the "L2044: symbol multiply defined" error.
Sample CodeC Compile options needed: None
INTERFACE TO SUBROUTINE SETARGV[C, ALIAS:'__setargv']() END INTERFACE TO SUBROUTINE SETENVP[C, ALIAS:'__setenvp']() END SUBROUTINE SETARGV RETURN END SUBROUTINE SETENVP RETURN END |
Additional reference words: 4.00 4.01 4.10 5.00 5.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |