Graphics Objects Heap Requirements

Last modified by Microchip on 2024/12/05 12:57

Heap Requirements for Graphics Objects

This page contains information for the Graphics Library found in Microchip Libraries for Applications (MLA). It is not relevant for the MPLAB® Harmony Graphics Library.

Memory Requirements for Graphics Applications

 MPLAB® XC16 CompilerMPLAB XC32 Compiler
Graphics ComponentFlashRAMHeapFlashRAMHeap
Primitive Layer32856608868530
Graphics Object Layer
Overhead
21243220 per
Style
Scheme
54002828 per
Style
Scheme
Button1131388 per
Instance
27481244 per
Instance
Check Box100828 per
Instance
2320436 per
Instance
Radio Button11141426 per
Instance
26322044 per
Instance
Slider/Scroll Bar23522032 per
Instance
57202444 per
Instance
Static Text792822 per
Instance
18841236 per
Instance
Progress Bar10721224 per
Instance
24521632 per
Instance
Group Box960824 per
Instance
21241236 per
Instance
Window807224 per
Instance
1996440 per
Instance
List Box2094628 per
Instance
25801244 per
Instance
Edit Box1008226 per
Instance
2332440 per
Instance
Meter25204240 per
Instance
67884068 per
Instance
Box1092832 per
Instance
32281240 per
Instance

All memory requirements are in bytes.

Back to top

Calculating the Required Heap Size

Most of the graphical components require some amount of memory set aside for the heap. Just how much is needed is determined by adding the memory requirements of each component module in the created routine. The overhead of the Graphics Object Layer is always included along with the requirements of each instance of the objects used.

Back to top

Example

For a PIC32 application which utilizes one style scheme and has one screen, which contains:

  • Six button objects
  • One dial object
  • Two Meter objects

and requires the following memory (in bytes):

 FlashRAMHeap 
Graphics Object Layer Overhead54002828 
Button Objects (6X)274812266 44 bytes/Button X 6 Buttons
Dial Object (1X)32281240 
Meter Object (2X)678840136 68 bytes/Meter X 2 Meters
   466Bytes needed for heap

Back to top