LegacyScreenSaver is a built-in macOS process that runs older screen saver components.
A - The warning usually means that an old or incompatible screen saver, wallpaper extension, or related component is using excessive memory.
B - Deleting the visible screen saver does not always remove the files that are causing the problem.
C - Check these folders for leftover screen saver files: ~/Library/Screen Savers and /Library/Screen Savers
D - Remove any old third-party .saver files, then restart your Mac.
E - You can also reset screen saver preferences by opening Terminal and running:
defaults -currentHost delete com.apple.screensaver
F - Then restart and select a built-in Apple screen saver.
G - If the issue continues, temporarily disable the screen saver in System Settings >> Lock Screen and see if the memory warning stops.
H - You can also check Activity Monitor to see whether LegacyScreenSaver continues growing in memory.
Apple’s related support pages:
Use Activity Monitor on Mac
Change Lock Screen settings on Mac
Update macOS on Mac