Hello EW Team,
I am working on plotting graph with data received every 50ms from another device (iMXRT1060) using Device Object. I have checked the RAM usage (PFA image).
OBSERVATION 1: Graph is successfully plotted for first 6 tests. While executing 7th time, EwProcess() is not getting executed. Regarding Memory Allocation:
#define EW_FRAME_BUFFER_ADDR DisplayInfo.FrameBuffer
#define EW_FRAME_BUFFER_SIZE EW_FRAME_BUFFER_WIDTH * EW_FRAME_BUFFER_HEIGHT * EW_FRAME_BUFFER_DEPTH //480*272*2 = 261,120
#define EW_DOUBLE_BUFFER_SIZE EW_FRAME_BUFFER_SIZE //480*272*2 = 261,120
#define EW_MEMORY_POOL_ADDR DisplayInfo.MemoryPool
#define EW_MEMORY_POOL_SIZE EW_FRAME_BUFFER_SIZE + EW_FRAME_BUFFER_SIZE //480*272*2*2
aDisplayInfo->FrameBuffer = (void*)os_mem_alloc(EW_FRAME_BUFFER_SIZE); // EW_FRAME_BUFFER_ADDR;
aDisplayInfo->DoubleBuffer = (void*)os_mem_alloc(EW_DOUBLE_BUFFER_SIZE); // EW_DOUBLE_BUFFER_ADDR;
aDisplayInfo->MemoryPool = (void*)os_mem_alloc(EW_MEMORY_POOL_SIZE); // EW_MEMORY_POOL_SIZE;
OBSERVATION 2: Graph is successfully plotted for first 13 tests. While executing 14th time, EwProcess() is not getting executed. Regarding Memory Allocation, only change is in Memory Pool Size:
#define EW_MEMORY_POOL_SIZE EW_FRAME_BUFFER_SIZE + EW_FRAME_BUFFER_SIZE + EW_FRAME_BUFFER_SIZE //480*272*2*3
QUERY 1: How shall I check the Memory usage? As soon as I add
#ifdef EW_PRINT_MEMORY_USAGE
EwPrintProfilerStatistic( 1 );
#endif
in my code, EwProcess() doesn't execute at all. However, I get the following in my Serial Logs, for first observation.
220909 12:56:35.38 GuiThread OS_mem_alloc : Alloc Size = 261120, 0x3fc00, at address 0x807da6e0
220909 12:56:35.38 GuiThread OS_mem_alloc : Alloc Size = 261120, 0x3fc00, at address 0x8081a300
220909 12:56:35.38 GuiThread OS_mem_alloc : Alloc Size = 522240, 0x7f800, at address 0x80859f20
QUERY 2: After plotting the graph, seems that data is still there in Device Object. If this is correct, then how should I free the memory allocated at the end of test so that fresh data is plotted; currently I am Clearing the screen using ChartsCoordList_ClearList( &_this->CoordList ); at the end of test. Does it clears the memory allocated to DeviceObject?
Thanks in advance,
Vandana Matai
