413 views
in Embedded Wizard Studio by
Hi, EW team:

     There is a memory usage estimation tool embedded in EW studio. After covering all use case, the tool will give an estimate of max RAM used as EW heap.

     I'd like to know if this estimate is reliable, because in real software integration, EW could sometimes fail to load some UI element even though the size of  RAM spared for heap is beyond the estimate from the tool.  Or is there any other reason that could lead to this failure?

    By the way, we are working with EW professional package.

 

Thank you.

1 Answer

0 votes
by

Hi Stephen,

first of all, let me refer to the article Memory Footprint, which describes all details concerning RAM and Flash memory usage.

Of course, the estimate within the RAM usage window of Embedded Wizard Studio is reliable - but the estimation shows the absolute minimum assuming a absolute minimum configuration (lowest possible glyph cache, lowest possible issue cache, immediate garbage collection,...). However, such configuration is not the best solution from a performance perspective.

In order to check the memory footprint on the target, you can monitor the memory RAM usage on the real system.

If you have further questions about the estimated versus real memory consumption, please let us know your system configuration (ewconfig.h).

Best regards,

Manfred.

by

Hi, Manfred

   Thank you for your answer. Below is the ewconfig.h we are using. Most comments in it were deleted for the limit of characters in comment.

 Best regards.
Stephen

#define EW_PLATFORM_STRING    "IMXRT1170-EVK"

#define SDRAM_BASE_ADDR       0x80000000
#define SDRAM_SIZE_BYTES      (0)

#define EW_USE_TERMINAL_INPUT 0
#define EW_CPU_LOAD_MEASURING 1

#define RTC_MINIMUM_TIME      978307200      /* 2001-01-01 0:00 */
#define RTC_DEFAULT_TIME      1619535600     /* 2021-04-27 15:00 */

#define EW_USE_EXTERNAL_FLASH 0

#if EW_USE_EXTERNAL_FLASH == 1

  #define EW_BITMAP_PIXEL_SECTION_NAME .SectionEwResource
  #define EW_FONT_PIXEL_SECTION_NAME   .SectionEwResource
  #define EW_FONT_DATA_SECTION_NAME    .SectionEwResource
  #define EW_CONST_STRING_SECTION_NAME .SectionEwResource

#endif

#define EW_USE_DOUBLE_BUFFER            1

#define EW_DISPLAY_WIDTH                320
#define EW_DISPLAY_HEIGHT               272

#define EW_FRAME_BUFFER_WIDTH           EW_DISPLAY_WIDTH
#define EW_FRAME_BUFFER_HEIGHT          EW_DISPLAY_HEIGHT

/* calculated addresses for framebuffer(s) */
#define EW_FRAME_BUFFER_ADDR  ((uint8_t*)s_frameBuffer)
#define EW_FRAME_BUFFER_SIZE  EW_FRAME_BUFFER_WIDTH * EW_FRAME_BUFFER_HEIGHT * EW_FRAME_BUFFER_DEPTH

#if EW_USE_DOUBLE_BUFFER == 1

  #define EW_DOUBLE_BUFFER_ADDR  (EW_FRAME_BUFFER_ADDR + EW_FRAME_BUFFER_SIZE)
  #define EW_DOUBLE_BUFFER_SIZE  EW_FRAME_BUFFER_SIZE

#else

  #define EW_DOUBLE_BUFFER_ADDR  0
  #define EW_DOUBLE_BUFFER_SIZE  0
  #define EW_NUMBER_OF_FIELDS    3

#endif

#define EW_USE_GRAPHICS_ACCELERATOR     1

#define EW_TOUCH_AREA_MIN_X                    0
#define EW_TOUCH_AREA_MIN_Y                    0
#define EW_TOUCH_AREA_MAX_X                    EW_DISPLAY_WIDTH
#define EW_TOUCH_AREA_MAX_Y                    EW_DISPLAY_HEIGHT
#define EW_TOUCH_SWAP_XY                       0

// #define EW_PRINT_TOUCH_DATA
// #define EW_PRINT_TOUCH_EVENTS

#define EW_MEMORY_POOL_ADDR      (s_EwHeap)
#define EW_MEMORY_POOL_SIZE      (1026*1024)

#define EW_EXTRA_POOL_ADDR       0
#define EW_EXTRA_POOL_SIZE       0

// #define EW_PRINT_MEMORY_USAGE
// #define EW_DUMP_HEAP

// #define EW_SUPPORT_GFX_TASK_TRACING
// #define EW_PRINT_GFX_TASKS
// #define EW_PRINT_PERF_COUNTERS
// #define EW_USE_IMMEDIATE_GARBAGE_COLLECTION

#define EW_MAX_STRING_CACHE_SIZE          0
#define EW_MAX_SURFACE_CACHE_SIZE       0
#define EW_MAX_GLYPH_SURFACE_WIDTH       32
#define EW_MAX_GLYPH_SURFACE_HEIGHT      32
#define EW_MAX_ISSUE_TASKS               6

#define EW_LAZY_LOAD_BITMAPS                              1
#define EW_LAZY_LOAD_BITMAPS_IF_ANIMATED_ONLY             1
#define EW_DISCARD_BITMAPS                                1
#define EW_DISCARD_BITMAPS_IF_ANIMATED_ONLY               1
#define EW_DISCARD_BITMAPS_IF_NOT_USED_IN_CURRENT_UPDATE  0
#define EW_DISCARD_BITMAPS_IF_NOT_USED_IN_RECENT_UPDATES  0
#define EW_CACHE_OFFSCREEN_SURFACES                       0

// #define EW_DONT_CHECK_INDEX

// #define EW_DONT_USE_WARP_FUNCTIONS
// #define EW_DONT_USE_PATH_FUNCTIONS
// #define EW_DONT_USE_BIDI_FUNCTIONS
// #define EW_DONT_USE_GRADIENTS
// #define EW_DONT_USE_COMPRESSION
// #define EW_DONT_USE_INDEX8_SURFACES
// #define EW_DONT_USE_RGB565_SURFACES
// #define EW_DONT_USE_NATIVE_SURFACES
// #define EW_DONT_USE_NATIVE_SURFACES_AS_DESTINATION

by

Hello,

thanks for the system configuration (BTW: you can upload files - there is no need to copy the content into the text).

The configuration for glyph cache should be increased - it is the minimum, but as a result the glyphs for text drawing will be reloaded again and again.

Do you have some issues on the target (e.g. out of memory)? Did you try the RAM usage on your target?

Best regards,

Manfred.

by
Hi, Manfred:
   Yes, message from console helps us much. The runtime error code gives us direction how to cope with it.
   Thank you very much.

Best regards.
Stephen

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...