KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q38271: Error C1059 Out of Near Heap Space

Article: Q38271
Product(s): See article
Version(s): 5.00 5.10 | 5.10
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | s_quickc s_error | mspl13_c
Last Modified: 30-NOV-1988

The following error is from "Fatal-Error Messages" in (1) the
"Microsoft C Optimizing Compiler User's Guide," Section E.3.1, Page
250, and in (2) the "Microsoft QuickC Compiler Programmer's Guide,"
Section D.1.1, Page 319:

C1059       out of near heap space

(1)         The compiler has run out of storage for items that it
            stores in the "near" (default data segment) heap. This
            usually means that your program has too many symbols or
            complex expressions. To correct the problem, divide the
            file into several smaller source files, or break
            expressions into smaller subexpressions.

(2)         The compiler ran out of storage for items that it stores
            in the "near" (default data segment) heap.

The compiler cannot recover from a fatal error; it terminates after
printing the error message.

The following is from "Part 2: Notes for the Microsoft C Optimizing
Compiler User's Guide" in the README.DOC file on Compiler Disk 1 for
Microsoft C Version 5.10. A similar section is found in the README
file on the Setup Disk for Version 5.00.

This release includes an alternate form of compiler pass 1 named
C1L.EXE. This compiler pass can be used to compile programs that get
the error message "out of near heap space". Invoke C1L.EXE by entering
the CL command with the /B1 <path> option, as follows:

   cl /B1 <path>\c1l.exe <sourcefile>.c

In the preceding command, <path> is the path (including drive and
directory) where C1L.EXE resides, and <sourcefile> is the name of the
C source file you want to compile.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.