Keil Logo

ARMCC: C4048U Out of Store while Compiling with -g


Information in this knowledgebase article applies to:

  • Keil MDK
  • Arm Compiler Version: 5.01u3, v5.05 (build 41) or later

SYMPTOM

When compiling a large C array, such as image data, the compiler outputs the following error:

Error: C4048U: out of store while compiling with -g. Allocation size was 1048576, system size is 341987156

CAUSE

The compiler ran out of its allocated memory. The "allocation size" is the amount of memory that the compiler was attempting to allocate at the moment that it ran out. The "system size" is the amount that it had successfully allocated up until that point.

RESOLUTION

There are several solutions to this issue:

  • Upgrade to the Arm Compiler 6.
  • Downgrade to earlier version of Arm Compiler 5. Some versions of Arm Compiler 5 are less likely to encounter the issue. In particular, Arm Compiler version 5.03 proved more robust against large arrays, after some brief tests. For more information about handling large arrays, in any compiler version, refer to the related knowledgebase article. See the links at the bottom of this article.
  • If the version of Arm Compiler 5 must remain the same, then use the following procedure:
    • Create a text file which contains the elements of your array, separated by commas.
    • Create as assembly file in Keil MDK which contains the following assembly code:
       AREA X, DATA
       EXPORT lab
      lab
       INCBIN insert_file_name.txt
       END
      

STATUS

Arm Compiler 5 is in maintenance, so this type of issue will not be resolved. The vast majority of development effort is now focused on Arm Compiler 6.

Out of memory error

In both Arm Compiler 5 and Arm Compiler 6 (using "AC5-like Warnings"), users may encounter a later error, after overcoming error 4048:

..\Desktop\LotsOfBytes.c(9736309): error:  #4: out of memory

This indicates that the PC's available physical memory (RAM) for the process has run out. Users can verify this issue in Windows Resource Monitor's Physical Memory plot. Close out unnecessary applications, especially tabs dealing with large files, and retry. Note that the Resource Monitor also consumes memory. Restarting the PC can free up Standby memory. Otherwise, a PC with more RAM may be required to complete the build.

MORE INFORMATION

SEE ALSO

Last Reviewed: Friday, January 8, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.