Filling unused memory

How do you fill all unused memory of a ESP32 with a known pattern encase the program counter fetched from this area?