Keil Logo

ARMCC: C4048U out of store while compiling with -g


Information in this knowledgebase article applies to:

  • MDK-ARM
  • ARMCC: 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 new compiler, armclang.
  • Downgrade to earlier version of armcc. Some versions of armcc are less likely to encounter the issue. In particular, v5.03 proved more robust against large arrays, after some brief tests. For more information about handling large arrays, in any compilter version, refer to the related knowledgebase article. See the links at the bottom of this article.
  • If the version of armcc 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 MDK which contains the following assembly code:
       AREA X, DATA
       EXPORT lab
      lab
       INCBIN insert_file_name.txt
       END
      

STATUS

armcc is in maintenance, so this type of issue will not be resolved. The vast majority of development effort is now focused on armclang.

Out of memory error

In both armcc and armclang (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: Wednesday, April 26, 2017


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.