Defender File Scanning gets stuck at 96%

I had a problem with Defender File Scanning. It gets stuck at 96%.

I get the following error in the Debug log

[02-Oct-2018 11:33:47 UTC] PHP Fatal error: Out of memory (allocated 155193344) (tried to allocate 20480 bytes) in /***/***/******.co.uk/***/***/***/***/***/***/***/File.php on line 2434

I also face SSL issue on the test site (Screenshot attached).

Help appreciated. Thank you