I was wondering if there is any indicator or way to monitor precisely the RAM usage of a screen or an application. It would be very helpful to me to know what percentage of LV_MEM_SIZE is used for instance.
I am currently running littlevgl on STM32R9I-Discovery board and using IAR Workbench.
Thank you very much in advance for your answers.
August 26, 2019, 2:45pm
As far as IAR’s heap is concerned, have a look at this,
static I Sys_Heap ( I idx )
* Also __iar_dmallinfo doc in iar_dmalloc.h
struct internal_malloc_stat_struct memInfo;
__iar_internal_malloc_stats( &memInfo );
" Size : %6u B, %5u W\n"
" Max availalbe : %6u B, %5u W\n"
"Current in use : %6u B, %5u W\n"
, memInfo.fp, memInfo.fp/4
, memInfo.maxfp, memInfo.maxfp/4
, memInfo.used, memInfo.used/4
struct mallinfo mInfo = __iar_dlmallinfo();
"non-mmapped space allocated from system, arena : %6u\n"
" number of free chunks, ordblocks : %6u\n"
" space in mmapped regions, hblkhnd : %6u\n"
" maximum total allocated space, usmblks : %6u\n"
" total allocated space, uordblks : %6u\n"
" total free space, fordblks : %6u\n"
" releasable (via malloc_trim) space, keepcost : %6u\n"
I do not think it is in the docs, but have a look at this app from the examples repo.
you can call lv_mem_monitor to find out what the lv heap memory status is.
Here’s an example of using
printf("used: %6d (%3d %%), frag: %3d %%, biggest free: %6d\n", (int)mon.total_size - mon.free_size,
Thank you very much ! I implemented your examples and it worked very well.