Hey Tom,
Can you use System.resetReason() and System.resetReasonData() - for after-reset analysis?
Example:
if (System.resetReason() == RESET_REASON_PANIC) {
uint32_t data = System.resetReasonData();
if (data == 8) { // Out of heap memory
<your actions>
}
}
you may know this, so please disregard if you do.