Improve the memory management for the watch dog timer #265