When Windows crashes, it collects information about the crash during the time that the Crash Screen is displayed. At this point, the OS collects information from running applications, drivers, ...
To fix high memory usage by Antimalware Service Executable on Windows 11, try turning off real-time protection, uninstalling pirated apps, scanning for malware, rescheduling Windows Defender scans, or ...