Can you please add some info about your setup, as detailed in https://retropie.org.uk/forum/topic/3/read-this-first ?
On the Pi4 (and 400) there's no need for the GPU memory split, that's required for earlier models. If you have installed from the RetroPie image downloaded from https://retropie.org.uk/download, the memory settings should be fine. For a Pi4, a 512 GPU split is excessive and will not help the performance.