Atmega328pb microncontroller hangs
From what you describe, something in the MCU goes into "latch-up", a hardware error state. This could be caused by wrong supply voltage, transients, overcurrent etc etc.
It can't have anything to do with software or a physical reset by pulling /reset pin low would have restored it. If you have dynamic heap allocation on a 8-bit MCU, your are doing it very very wrong. So there should be nothing that could cause memory leaks.
The watchdog would work similar to pulling the /reset pin low. What you can do though, is to measure if the MCU is repeatedly resetting through watchdog or other sources, by monitoring the /reset pin with an oscilloscope.
One obviously fishy thing is 4V. Why on earth do you have such a weird supply voltage? Industry standards are 3.3V or 5V respectively. Are you driving the MCU directly from raw batteries or something? It needs a stable supply from a voltage regulator, or otherwise you'll experience brown-out phenomenon and/or resets caused by brown-out detect circuitry.