PRB: F1901: "Program Too Large for Memory" Error

Last reviewed: July 20, 1995
Article ID: Q49708
The information in this article applies to:
  • Microsoft FORTRAN for MS-DOS, versions 4.0, 4.01, 4.1, 5.0, 5.1
  • Microsoft FORTRAN for OS/2, versions 4.1, 5.0, 5.1

SYMPTOMS

Compiling an application causes the compiler to generate the following message:

   F1901: program too large for memory

CAUSE

One possible cause is that the application includes a DATA statement that contains an extensive amount of data. The compiler stores data in the near heap during compilation. The error occurs when the near heap is exhausted. See the Sample code below.

RESOLUTION

To address this situation, perform one of the two steps below:

  • In FORTRAN versions 5.0 and 5.1, perform the appropriate steps below to use the high-capacity FORTRAN compiler.
  • In versions of FORTRAN prior to version 5.0, modify the source code to remove the huge DATA statement. Read the required information from a data file or use assignment statements.

FORTRAN PowerStation will successfully compile the sample code below.

MORE INFORMATION

By default, the SETUP program for FORTRAN version 5.1 installs F1L.EXE into the C:\FORTRAN\BIN directory. The compiler command line is as follows:

   FL /B1 F1L.EXE TEST.FOR

In FORTRAN version 5.0, copy the F1L.EXE file from the High Capacity Compiler Disk into the FORTRAN BIN directory (by default, C:\FORTRAN\BIN). The compiler command line is as follows:

   FL /B1 C:\FORTRAN\BIN\F1L.EXE TEST.FOR

The following code example demonstrates this situation. If you change the array subscript in the declaration for the TMP array from 254 to 256, or if you add another data item to the source code, the program is too large for the first pass of the FORTRAN compiler to process. To address this situation, use the high-capacity FORTRAN compiler as discussed above.

Sample Code

C Compile options needed: See above

      SUBROUTINE TEST ()
      REAL TMP(254) ! LOW CC LIMIT 254
      DATA TMP / 0.0, .035, .049, .049, 0.0, 0.0, .068, .068, 0.0,
     Z         .095, .095, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049,
     Z         .065, .065, 0.0, 0.0, .088, .088, 0.0, .119, .119,
     Z         0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049, .065, .065,
     Z         0.0, 0.0, .091, .091, 0.0, .126, .126, 0.0, 0.0,
     Z         0.0, 0.0, 0.0, .065, .065, .083, .083, 0.0, 0.0,
     Z         .109, .109, 0.0, .147, .147, 0.0, 0.0, 0.0, .187,
     Z         .294, .065, .065, .083, .083, 0.0, 0.0, .113, .113,
     Z         0.0, .154, .154, 0.0, 0.0, 0.0, .218, .308, .065,
     Z         .065, .109, .109, 0.0, 0.0, .133, .133, 0.0, .179,
     Z         .179, 0.0, 0.0, 0.0, .250, .358, .065, .065, .109,
     Z         .109, 0.0, 0.0, .140, .140, 0.0, .191, .191, 0.0,
     Z         0.0, 0.0, .250, .382, .065, .065, .109, .109, 0.0,
     Z         .095, .095, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049,
     Z         .065, .065, 0.0, 0.0, .088, .088, 0.0, .119, .119,
     Z         0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049, .065, .065,
     Z         0.0, 0.0, .091, .091, 0.0, .126, .126, 0.0, 0.0,
     Z         0.0, 0.0, 0.0, .065, .065, .083, .083, 0.0, 0.0,
     Z         .109, .109, 0.0, .147, .147, 0.0, 0.0, 0.0, .187,
     Z         .294, .065, .065, .083, .083, 0.0, 0.0, .113, .113,
     Z         0.0, .154, .154, 0.0, 0.0, 0.0, .218, .308, .065,
     Z         .065, .109, .109, 0.0, 0.0, .133, .133, 0.0, .179,
     Z         .179, 0.0, 0.0, 0.0, .250, .358, .065, .065, .109,
     Z         .109, 0.0, 0.0, .140, .140, 0.0, .191, .191, 0.0,
     Z         0.0, 0.0, .250, .382, .065, .065, .109, .109, 0.0,
     Z         .095, .095, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049,
     Z         0.0, 0.0, .091, .091, 0.0, .126, .126, 0.0, 0.0,
     Z         0.0, 0.0, 0.0, .065, .065, .083, .083, 0.0, 0.0,
     Z         .109, .109, 0.0, .147, .147, 0.0, 0.0, 0.0, .187,
     Z         .294, .065, .065, .083, .083, 0.0, 0.0, .113, .113,
     Z         0.0, .154, .154, 0.0, 0.0, 0.0, .218, .308, .065,
     Z         .065, .109, .109, 0.0, 0.0, .133, .133, 0.0, .179,
     Z         .179, 0.0, 0.0, 0.0, .250, .358, .065, .065, .109,
     Z         .109, 0.0, 0.0, .140, .140, 0.0, .191, .191, 0.0,
     Z         0.0, 0.0, .250, .382, .065, .065, .109, .109, 0.0,
     Z         .095, .095, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049,
     Z         .065, .065, 0.0, 0.0, .088, .088, 0.0, .119, .119,
     Z         0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049, .065, .065,
     Z         0.0, 0.0, .091, .091, 0.0, .126, .126, 0.0, 0.0,
     Z         0.0, 0.0, 0.0, .065, .065, .083, .083, 0.0, 0.0,
     Z         .109, .109, 0.0, .147, .147, 0.0, 0.0, 0.0, .187,
     Z         .294, .065, .065, .083, .083, 0.0, 0.0, .113, .113,
     Z         0.0, .154, .154, 0.0, 0.0, 0.0, .218, .308, .065,
     Z         .065, .109, .109, 0.0, 0.0, .133, .133, 0.0, .179,
     Z         .179, 0.0, 0.0, 0.0, .250, .358, .065, .065, .109,
     Z         .109, 0.0, 0.0, .140, .140, 0.0, .191, .191, 0.0,
     Z         0.0, 0.0, .250, .382, .065, .065, .109, .109, 0.0,
     Z         .095, .095, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049,
     Z         .065, .065, 0.0, 0.0, .088, .088, 0.0, .119, .119,
     Z         0.0, 0.0, 0.0, 0.0, 0.0, 0.0, .049, .065, .065,
     Z         0.0, 0.0, .091, .091, 0.0, .126, .126, 0.0, 0.0,
     Z         0.0, 0.0, 0.0, .065, .065, .083, .083, 0.0, 0.0,
     Z         .109, .109, 0.0, .147, .147, 0.0, 0.0, 0.0, .187,
     Z         .294, .065, .065, .083, .083, 0.0, 0.0, .113, .113,
     Z         0.0, .154, .154, 0.0, 0.0, 0.0, .218, .308, .065,
     Z         .065, .109, .109, 0.0, 0.0, .133, .133, 0.0, .179,
     Z         .179, 0.0, 0.0, 0.0, .250, .358, .065, .065, .109,
     Z         .109, 0.0, 0.0, .140, .140, 0.0, .191, .191, 0.0,
     Z         0.0, 0.0, .250, .382, .065, .065, .109, .109, 0.0,
     Z         0.0, .145, .145, 0.0, .200, .200, 0.0, 0.0, 0.0, .281/
      WRITE (*,*) TMP
      END


Additional reference words: 4.00 4.01 4.10 5.00 5.10
KBCategory: kbtool kbprb kberrmsg
KBSubcategory: FLIss


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.

Last reviewed: July 20, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.