I upped the memory limit to 768M, which is the maximum that siteground allows on a managed account. It helped a bit but still having the same problem. “Allowed memory size of 805306368 bytes exhausted (tried to allocate 6622839590912 bytes)”.
Thanks
david