System.on(out_of_memory, outOfMemoryHandler);

I tried searching the Github repository for how the outOfMemory is calculated or determined but couldn’t find anything on it. Does anyone know where I can find more details about this?

void outOfMemoryHandler(system_event_t event, int param) {
outOfMemory = param;
}

System.on(out_of_memory, outOfMemoryHandler);

@wesner0019, I believe “out of memory” is declared when a heap allocation is attempted (eg. malloc()) and it fails. The failure may be due to the largest (contiguous) available block of heap is not large enough to satisfy the request. This, of course, may be due to heap fragmentation or simply running out of heap.

2 Likes

Yes, peekay123 is correct.

An example of the usage is in the the application note AN023 Watchdog Timers.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.