Hello. I have found that, in OpenAT 4.11, whenever I use the adl_atCmdCreate() call, I lose 32 bytes of heap memory. I’m testing various things every second (signal strength, A/D levels, neighbouring GSM cells) and so, after about 2 hours, the application runs out of memory and the module resets.
I’d like to know if you can reproduce it with the following code (modification of Hello World), and if there’s a fix. It crashes around cycle 7808.
bool main_test_Handler(adl_atResponse_t *paras)
{
return FALSE;
}
static int cycle=0;
void HelloWorld_TimerHandler ( u8 ID )
{
ascii buff[100];
/* Hello World */
TRACE (( 1, "Embedded : Hello World" ));
cycle++;
wm_sprintf(buff, "\r\nCycle=%d\r\n", cycle);
adl_atSendResponse ( ADL_AT_UNS, buff);
adl_atCmdCreate("ATI", FALSE, main_test_Handler, "*", NULL);
}
I’m actually using a binary search (with adl_memGet/adl_memRelease) to find the exact amount of free memory, so I know that it’s 32 bytes for every call.
I wonder why no one has noticed this yet? This is pretty serious, IMHO.
My module returns
The memory also leaks in Debug mode, but the available memory there is over 1 MB, so it would take forever to wait for the crash.
Thanks in advance for any help,
Milan