3.5.15 How Do I Know How Much Memory Is Still Available?

A memory usage summary is available from the compiler after compilation (--report-mem option), from MPLAB X IDE in the Dashboard window. All of these summaries indicate the amount of memory used and the amount still available, but none indicate whether this memory is one contiguous block or broken into many small chunks. Small blocks of free memory cannot be used for larger objects and so out-of-memory errors may be produced even though the total amount of memory free is apparently sufficient for the objects to be positioned.

Additionally, a Memory Report by Module, showing the memory usage (text, data, and bss sections) per object file, is provided. This report indicates the size in the final ELF file attributable to each input object. A miscellaneous entry showing those sections whose input object file cannot be determined or the type of memory cannot be established is also shown.

Consult the linker map file to determine exactly what memory is still available in each linker class. This file also indicates the largest contiguous block in that class if there are memory page divisions. See the MPLAB® XC32 Assembler, Linker and Utilities User’s Guide (DS50002186) for information on the map file.